Project1
标题:
新手脚本求救。。文字不显示
[打印本页]
作者:
风若·飘絮
时间:
2013-4-30 18:50
标题:
新手脚本求救。。文字不显示
本帖最后由 风若·飘絮 于 2013-5-1 21:31 编辑
class Ui < Window_Base
def initialize
super(0,0,640,480)
@tu = Sprite.new
@tu.bitmap = RPG::Cache.title("人物状态.png")
@tu.x=60
@tu.y=0
@tu.z=200
@contents = Bitmap.new(608,448)
@contents.font.name = "黑体"
@contents.font.size = 40
@contents.font.color =Color.new(255,255,255,255)
refresh
end
def refresh
tu.update
@contents.draw_text(55, 42, 200, 32,"4566654646546")
end
end
复制代码
我在事件里创建的对象,只显示图片,不显示文字
作者:
SuperMario
时间:
2013-4-30 19:14
要用 self.contents
不知道为什么 self.contents 指向的不是 @contents
作者:
风若·飘絮
时间:
2013-4-30 20:06
SuperMario 发表于 2013-4-30 19:14
要用 self.contents
不知道为什么 self.contents 指向的不是 @contents
用self还是无效,我觉得和这个应该没什么关系吧,因为其他语言里self.是私有变量关键字(RUBY用法不知)
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1