Class: Hokusai::Canvas

Inherits:
Object
  • Object
show all
Defined in:
ui/src/hokusai/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(width, height, x = 0.0, y = 0.0, vertical = true, reverse = false) ⇒ Canvas

Returns a new instance of Canvas.



125
126
127
128
129
130
131
132
# File 'ui/src/hokusai/types.rb', line 125

def initialize(width, height, x = 0.0, y = 0.0, vertical = true, reverse = false)
  @width = width
  @height = height
  @x = x
  @y = y
  @vertical = vertical
  @reverse = reverse
end

Instance Attribute Details

#heightObject

Returns the value of attribute height.



124
125
126
# File 'ui/src/hokusai/types.rb', line 124

def height
  @height
end

#reverseObject

Returns the value of attribute reverse.



124
125
126
# File 'ui/src/hokusai/types.rb', line 124

def reverse
  @reverse
end

#verticalObject

Returns the value of attribute vertical.



124
125
126
# File 'ui/src/hokusai/types.rb', line 124

def vertical
  @vertical
end

#widthObject

Returns the value of attribute width.



124
125
126
# File 'ui/src/hokusai/types.rb', line 124

def width
  @width
end

#xObject

Returns the value of attribute x.



124
125
126
# File 'ui/src/hokusai/types.rb', line 124

def x
  @x
end

#yObject

Returns the value of attribute y.



124
125
126
# File 'ui/src/hokusai/types.rb', line 124

def y
  @y
end

Instance Method Details

#reset(x, y, width, height, vertical: true, reverse: false) ⇒ Object



134
135
136
137
138
139
140
141
# File 'ui/src/hokusai/types.rb', line 134

def reset(x, y, width, height, vertical: true, reverse: false)
  self.x = x
  self.y = y
  self.width = width
  self.height = height
  self.vertical = vertical
  self.reverse = reverse
end

#reverse?Boolean

Returns:

  • (Boolean)


147
148
149
# File 'ui/src/hokusai/types.rb', line 147

def reverse?
  reverse
end

#to_boundsObject



143
144
145
# File 'ui/src/hokusai/types.rb', line 143

def to_bounds
  Hokusai::Rect.new(x, y, width, height)
end

#to_hoku_rectObject



151
152
153
# File 'ui/src/hokusai/types.rb', line 151

def to_hoku_rect
  LibHokusai::HmlRect.create(x, y, width, height)
end