mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 14:44:58 +00:00
Initial proof of concept commit
This commit is contained in:
24
Data/Scripts/905_New controls/002 label.rb
Normal file
24
Data/Scripts/905_New controls/002 label.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class UIControls::Label < UIControls::BaseControl
|
||||
attr_reader :label
|
||||
|
||||
LABEL_END_X = 80
|
||||
TEXT_OFFSET_Y = 7
|
||||
|
||||
def initialize(width, height, viewport, label)
|
||||
super(width, height, viewport)
|
||||
@label = label
|
||||
end
|
||||
|
||||
def label=(value)
|
||||
@label = value
|
||||
refresh
|
||||
end
|
||||
|
||||
def refresh
|
||||
super
|
||||
draw_text(self.bitmap, 4, TEXT_OFFSET_Y, @label)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user