Project1
标题: 请问如何显示图片 [打印本页]
作者: j296196585 时间: 2017-6-20 00:22
标题: 请问如何显示图片
小肉包 大人 那个帖子不能在发问题了
draw_actor_face
这个是显示图片用的
可是要吗出错
要吗没反应
draw_actor_face
这个是显示图片用的
可是要吗出错
要吗没反应
class Scene_FF < Scene_Base
def start
super
c_ff
end
def c_ff
@bl = W_FF.new
@bl.set_handler(:cancel, method(:return_scene))
end
end
class W_FF < Window_Selectable
def initialize
super(0,0,544,416)
refresh
activate
end
def refresh
contents.clear
if $game_switches[202]==true
contents.font.color = Color.new(255, 255, 0, 255)
draw_text(0, 0, 100, 32,"剑越卄" )
case $game_variables[52]
when 0
draw_text(88, 0, 126, 32,"一面之缘" )
when 10
draw_text(88, 0, 126, 32,"颇有好感" )
when 20
draw_text(88, 0, 126, 32,"惺惺相惜" )
when 30
draw_text(88, 0, 126, 32,"爱慕倾心" )
when 40
draw_text(88, 0, 126, 32,"生死与共" )
end
end
if $game_switches[203]==true
contents.font.color = Color.new(0, 255, 0, 255)
draw_text(0, 32, 128, 32,"幻羽" )
case $game_variables[53]
when -10
draw_text(88, 32, 126, 32,"不胜厌恶" )
when 0
draw_text(88, 32, 126, 32,"一面之缘" )
when 10
draw_text(88, 32, 126, 32,"颇有好感" )
when 20
draw_text(88, 32, 126, 32,"惺惺相惜" )
when 30
draw_text(88, 32, 126, 32,"爱慕倾心" )
when 40
draw_text(88, 32, 126, 32,"生死与共" )
end
end
if $game_switches[202]==false
draw_text(250, 200, 126, 32,"暂无人物关系" )
end
end
end
class Scene_FF < Scene_Base
def start
super
c_ff
end
def c_ff
@bl = W_FF.new
@bl.set_handler(:cancel, method(:return_scene))
end
end
class W_FF < Window_Selectable
def initialize
super(0,0,544,416)
refresh
activate
end
def refresh
contents.clear
if $game_switches[202]==true
contents.font.color = Color.new(255, 255, 0, 255)
draw_text(0, 0, 100, 32,"剑越卄" )
case $game_variables[52]
when 0
draw_text(88, 0, 126, 32,"一面之缘" )
when 10
draw_text(88, 0, 126, 32,"颇有好感" )
when 20
draw_text(88, 0, 126, 32,"惺惺相惜" )
when 30
draw_text(88, 0, 126, 32,"爱慕倾心" )
when 40
draw_text(88, 0, 126, 32,"生死与共" )
end
end
if $game_switches[203]==true
contents.font.color = Color.new(0, 255, 0, 255)
draw_text(0, 32, 128, 32,"幻羽" )
case $game_variables[53]
when -10
draw_text(88, 32, 126, 32,"不胜厌恶" )
when 0
draw_text(88, 32, 126, 32,"一面之缘" )
when 10
draw_text(88, 32, 126, 32,"颇有好感" )
when 20
draw_text(88, 32, 126, 32,"惺惺相惜" )
when 30
draw_text(88, 32, 126, 32,"爱慕倾心" )
when 40
draw_text(88, 32, 126, 32,"生死与共" )
end
end
if $game_switches[202]==false
draw_text(250, 200, 126, 32,"暂无人物关系" )
end
end
end
-
360截图20170620002002192.jpg
(63.11 KB, 下载次数: 14)
请问如何显示图片
作者: 魔法丶小肉包 时间: 2017-6-20 10:04
直接用draw_face吧,draw_face(face_name, face_index, x, y, enabled = true)
也就是说draw_face(图片名, 图片索引, x坐标, y坐标)
素材格式和尺寸请参考默认的脸图素材
如果不想用这种尺寸的话,可以把这个方法复制到W_FF改一改
作者: j296196585 时间: 2017-6-20 14:33
本帖最后由 j296196585 于 2017-6-20 14:35 编辑
(face_name, face_index, x, y, enabled = true)看不懂
也就是说draw_face(图片名, 图片索引, x坐标, y坐标)图片索引 这什么意思也不懂
draw_icon(2,126,35,true) #图标 我居然会图标了好难得
draw_face(1, 1, 126, 36, enabled = true)#头像 不会 不懂 无奈
draw_face(1, 1, 126, 36)#头像 不会 不懂 怎么办
-
360截图20170620143452919.jpg
(23.74 KB, 下载次数: 12)
作者: j296196585 时间: 2017-6-20 22:17
本帖最后由 j296196585 于 2017-6-20 22:22 编辑
初始脚本
大概就是下图这个样子 不知道行不行
本来一直在做XP游戏 XP脚本也摸索的差不多 只是战斗系统崩溃 就转战VA了
class Scene_FF < Scene_Base
def start
super
c_ff
end
def c_ff
@bl = W_FF.new
@bl.set_handler(:cancel, method(:return_scene))
end
end
class W_FF < Window_Selectable
def initialize
super(0,0,544,416)
refresh
activate
end
def refresh
contents.clear
if $game_switches[202]==true
contents.font.color = Color.new(0, 255, 0, 255)
draw_text(0, 0, 128, 32,"剑越卄" )
case $game_variables[52]
when 0
draw_text(88, 0, 126, 32,"一面之缘" )
when 10
draw_text(88, 0, 126, 32,"颇有好感" )
when 20
draw_text(88, 0, 126, 32,"惺惺相惜" )
when 30
draw_text(88, 0, 126, 32,"爱慕倾心" )
when 40
draw_text(88, 0, 126, 32,"生死与共" )
end
end
if $game_switches[203]==true
contents.font.color = Color.new(0, 255, 0, 255)
draw_text(0, 32, 128, 32,"幻羽" )
case $game_variables[53]
when -10
draw_text(88, 32, 126, 32,"不胜厌恶" )
when 0
draw_text(88, 32, 126, 32,"一面之缘" )
when 10
draw_text(88, 32, 126, 32,"颇有好感" )
when 20
draw_text(88, 32, 126, 32,"惺惺相惜" )
when 30
draw_text(88, 32, 126, 32,"爱慕倾心" )
when 40
draw_text(88, 32, 126, 32,"生死与共" )
end
end
if $game_switches[202]==false
draw_text(250, 200, 126, 32,"暂无人物关系" )
end
end
end
class Scene_FF < Scene_Base
def start
super
c_ff
end
def c_ff
@bl = W_FF.new
@bl.set_handler(:cancel, method(:return_scene))
end
end
class W_FF < Window_Selectable
def initialize
super(0,0,544,416)
refresh
activate
end
def refresh
contents.clear
if $game_switches[202]==true
contents.font.color = Color.new(0, 255, 0, 255)
draw_text(0, 0, 128, 32,"剑越卄" )
case $game_variables[52]
when 0
draw_text(88, 0, 126, 32,"一面之缘" )
when 10
draw_text(88, 0, 126, 32,"颇有好感" )
when 20
draw_text(88, 0, 126, 32,"惺惺相惜" )
when 30
draw_text(88, 0, 126, 32,"爱慕倾心" )
when 40
draw_text(88, 0, 126, 32,"生死与共" )
end
end
if $game_switches[203]==true
contents.font.color = Color.new(0, 255, 0, 255)
draw_text(0, 32, 128, 32,"幻羽" )
case $game_variables[53]
when -10
draw_text(88, 32, 126, 32,"不胜厌恶" )
when 0
draw_text(88, 32, 126, 32,"一面之缘" )
when 10
draw_text(88, 32, 126, 32,"颇有好感" )
when 20
draw_text(88, 32, 126, 32,"惺惺相惜" )
when 30
draw_text(88, 32, 126, 32,"爱慕倾心" )
when 40
draw_text(88, 32, 126, 32,"生死与共" )
end
end
if $game_switches[202]==false
draw_text(250, 200, 126, 32,"暂无人物关系" )
end
end
end
-
天下第一.png
(155.33 KB, 下载次数: 3)
-
主角_看图王.png
(24.8 KB, 下载次数: 6)
作者: 魔法丶小肉包 时间: 2017-6-20 23:16
像这样吗?
- class Scene_FF < Scene_Base
- def start
- super
- c_ff
- end
- def c_ff
- @bl = W_FF.new
- @bl.set_handler(:cancel, method(:return_scene))
- end
- end
- class W_FF < Window_Selectable
- def initialize
- super(0,0,544,416)
- refresh
- activate
- end
- def refresh
- contents.clear
- if $game_switches[202]==true
- contents.font.color = Color.new(0, 255, 0, 255)
- draw_text(100, 0, 128, 32,"剑越卄" )
- draw_face("主角", 0, 0, 0)
- case $game_variables[52]
- when 0
- draw_text(188, 0, 126, 32,"一面之缘" )
- when 10
- draw_text(188, 0, 126, 32,"颇有好感" )
- when 20
- draw_text(188, 0, 126, 32,"惺惺相惜" )
- when 30
- draw_text(188, 0, 126, 32,"爱慕倾心" )
- when 40
- draw_text(188, 0, 126, 32,"生死与共" )
- end
- end
- if $game_switches[203]==true
- contents.font.color = Color.new(0, 255, 0, 255)
- draw_text(0, 32, 128, 32,"幻羽" )
- case $game_variables[53]
- when -10
- draw_text(88, 32, 126, 32,"不胜厌恶" )
- when 0
- draw_text(88, 32, 126, 32,"一面之缘" )
- when 10
- draw_text(88, 32, 126, 32,"颇有好感" )
- when 20
- draw_text(88, 32, 126, 32,"惺惺相惜" )
- when 30
- draw_text(88, 32, 126, 32,"爱慕倾心" )
- when 40
- draw_text(88, 32, 126, 32,"生死与共" )
- end
- end
- if $game_switches[202]==false
- draw_text(250, 200, 126, 32,"暂无人物关系" )
- end
- end
- def draw_face(face_name, face_index, x, y, enabled = true)
- bitmap = Cache.face(face_name)
- rect = Rect.new(face_index % 4 * 96, face_index * 96, 96, 96)
- contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
- bitmap.dispose
- end
- end
复制代码
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |