mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-17 13:32:34 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 739ae86966 | |||
| 3be16c644f | |||
| 805077d232 | |||
| db1a0683e2 |
@@ -160,5 +160,9 @@ module CyberarmEngine
|
|||||||
def to_s
|
def to_s
|
||||||
"X: #{@x}, Y: #{@y}, Z: #{@z}, Weight: #{@weight}"
|
"X: #{@x}, Y: #{@y}, Z: #{@z}, Weight: #{@weight}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def to_h
|
||||||
|
{x: @x, y: @y, z: @z, weight: @weight}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -6,7 +6,7 @@ module CyberarmEngine
|
|||||||
attr_reader :text, :textobject
|
attr_reader :text, :textobject
|
||||||
|
|
||||||
def initialize(text, options={})
|
def initialize(text, options={})
|
||||||
@text = text || ""
|
@text = text.to_s || ""
|
||||||
@options = options
|
@options = options
|
||||||
@size = options[:size] || 18
|
@size = options[:size] || 18
|
||||||
@font = options[:font] || "sans-serif"#Gosu.default_font_name
|
@font = options[:font] || "sans-serif"#Gosu.default_font_name
|
||||||
@@ -72,7 +72,7 @@ module CyberarmEngine
|
|||||||
end
|
end
|
||||||
|
|
||||||
def height
|
def height
|
||||||
(@text.lines.count) * textobject.height
|
@text.lines.count > 0 ? (@text.lines.count) * textobject.height : @textobject.height
|
||||||
end
|
end
|
||||||
|
|
||||||
def draw
|
def draw
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module CyberarmEngine
|
module CyberarmEngine
|
||||||
NAME = "InDev"
|
NAME = "InDev"
|
||||||
VERSION = "0.4.0"
|
VERSION = "0.5.1"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user