duma @ ウィキ

てけとう

最終更新:

duma

- view
管理者のみ編集可
require 'dxruby'



module EFTX
@font = Font.new 16
@sprites = []
def self.set(text,x,y,type)
font = @font
image = Image.new(font.getWidth(text),font.size)
image.drawFont(0,0,text,font)
ary = text.split(/./)
total_length = 0
for i in 0..ary.size
#total_length += font.getWidth(ary[i])
@sprites.push Character.new(
image.slice(total_length,0,font.getWidth(ary[i]),font.size),
0,
0,
x,
y,
16,
nil
)
end
end
def self.update
@sprites.each{|i|i.update}
end
class Character
def initialize(image,sx,sy,dx,dy,spd,id)
@image = image
@x = sx
@y = sy
end
def update
Window.draw(@x,@y,@image)
end
end

end

FONT = Font.new(16)
image = Image.new(640,480)
image.drawFont(100,100,"イベントホライゾン",FONT)
EFTX.set("スタンダード病理学第二版",300,240,nil)
Window.loop do
EFTX.update
Window.draw(0,0,image)
end
目安箱バナー