class Cards::Card
- Cards::Card
- Reference
- Object
Included Modules
- JSON::Serializable
Defined in:
cards/card.crConstant Summary
-
DROP_SHADOW =
1
-
HEIGHT =
88
-
HEIGHT_DEPTH =
0.666_f32
-
MARGIN =
10
-
MOVEMENT_FRAMES =
16
-
WIDTH =
64
-
bicycle card size in mm from https://en.wikipedia.org/wiki/Standard_52-card_deck#Size_of_the_cards
Constructors
- .new(rank : Cards::Rank, suit : Cards::Suit, flipped : Bool = true, position : Game::Vector = Game::Vector.new)
- .new(pull : JSON::PullParser)
Class Method Summary
Instance Method Summary
- #clone : Card
- #draw(deck, screen_x = 0, screen_y = 0)
- #draw_shadow(screen_x, screen_y)
- #flip
- #flipped=(flipped : Bool)
- #flipped? : Bool
- #height
- #height_depth
- #mouse_in?
- #move(move_to : Game::Vector, frames = MOVEMENT_FRAMES)
- #moved?
- #moving?
- #name
- #position : Game::Vector
- #position=(position : Game::Vector)
- #rank : Rank
- #rank=(rank : Rank)
- #short_name
- #suit : Suit
- #suit=(suit : Suit)
-
#to_s(io : IO)
Appends a short String representation of this object which includes its class name and its object address.
- #update(frame_time)
-
#width
methods for width/height in case of changing to instance vars later
- #x(*args, **options)
- #x(*args, **options, &)
- #x=(arg)
- #y(*args, **options)
- #y(*args, **options, &)
- #y=(arg)
Constructor Detail
def self.new(rank : Cards::Rank, suit : Cards::Suit, flipped : Bool = true, position : Game::Vector = Game::Vector.new)
#
Class Method Detail
Instance Method Detail
def to_s(io : IO)
#
Description copied from class Reference
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>