class

Cards::Card

Inherits JSON::Serializable < Reference < Object

Constants

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)
Source
new(pull : JSON::PullParser)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Class methods

height
Source
height_depth
Source
margin
Source
width
Source

Instance methods

clone
Source
draw(deck, screen_x = 0, screen_y = 0)
Source
draw_shadow(screen_x, screen_y)
Source
flip
Source
flipped=(flipped : Bool)
Source
flipped?
Source
height
Source
height_depth
Source
mouse_in?
Source
move(move_to : Game::Vector, frames = MOVEMENT_FRAMES)
Source
moved?
Source
moving?
Source
name
Source
position
Source
position=(position : Game::Vector)
Source
rank
Source
rank=(rank : Rank)
Source
short_name
Source
suit
Source
suit=(suit : Suit)
Source
to_s(io : IO)

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>
Source
update(frame_time)
Source
width

methods for width/height in case of changing to instance vars later

Source
x(*args, **options)
Source
x(*args, **options, &)
Source
x=(arg)
Source
y(*args, **options)
Source
y(*args, **options, &)
Source
y=(arg)
Source