mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
release 6.2
This commit is contained in:
51
Data/Scripts/051_AddOns/DisplayText.rb
Normal file
51
Data/Scripts/051_AddOns/DisplayText.rb
Normal file
@@ -0,0 +1,51 @@
|
||||
def Kernel.pbDisplayText(message,xposition,yposition,z=nil, baseColor=nil, shadowColor=nil)
|
||||
if @hud==nil
|
||||
@hud = []
|
||||
end
|
||||
# Draw the text
|
||||
baseColor= baseColor ? baseColor : Color.new(72,72,72)
|
||||
shadowColor= shadowColor ? shadowColor : Color.new(160,160,160)
|
||||
sprite = BitmapSprite.new(Graphics.width,Graphics.height,@viewport1)
|
||||
if z != nil
|
||||
sprite.z=z
|
||||
end
|
||||
@hud.push(sprite)
|
||||
|
||||
text1=_INTL(message)
|
||||
textPosition=[
|
||||
[text1,xposition,yposition,2,baseColor,shadowColor],
|
||||
]
|
||||
pbSetSystemFont(@hud[-1].bitmap)
|
||||
pbDrawTextPositions(@hud[0].bitmap,textPosition)
|
||||
end
|
||||
|
||||
def Kernel.pbDisplayNumber(number,xposition,yposition)
|
||||
@numT = []
|
||||
# Draw the text
|
||||
baseColor=Color.new(72,72,72)
|
||||
shadowColor=Color.new(160,160,160)
|
||||
@numT.push(BitmapSprite.new(Graphics.width,Graphics.height,@viewport1))
|
||||
text1=_INTL(number.to_s)
|
||||
textPosition=[
|
||||
[text1,xposition,yposition,2,baseColor,shadowColor],
|
||||
]
|
||||
pbSetSystemFont(@numT[-1].bitmap)
|
||||
pbDrawTextPositions(@numT[0].bitmap,textPosition)
|
||||
end
|
||||
|
||||
def Kernel.pbClearNumber()
|
||||
if @numT != nil then
|
||||
for sprite in @numT
|
||||
sprite.dispose
|
||||
end
|
||||
@numT.clear
|
||||
end
|
||||
end
|
||||
def Kernel.pbClearText()
|
||||
if @hud != nil then
|
||||
for sprite in @hud
|
||||
sprite.dispose
|
||||
end
|
||||
@hud.clear
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user