game.draw_fps_mode true
game.loading do |loader|
loader.add :window, :system => "window"
loader.add :gui_item, :system => "gui_item"
loader.add :m_tes, 184
loader.add :chr_tes, 186
end
game.on_init do
set_window_image :window
set_gui_image :gui_item
speak "クリックした場所にキャラ配置"
scene_change :mouse_test
end
scene :mouse_test do |m_test|
m_test.on_init do
m_test.add :image, :name => :mmm, :template => :m_temp, :position => [0, 0]
m_test.event :mmm, :on_touch_move do |event|
#speak ("X:" + event.screen_x.to_s + "\nY:" + event.screen_y.to_s)
m_test.add :image, :name => :mmm2, :template => :chr_temp, :center_position => [event.screen_x, event.screen_y]
end
end
end
sprite_template :m_temp do |st|
st.texture :m_tes
st.src_size 640, 480
st.dest_size 640, 480
end
sprite_template :chr_temp do |st|
st.texture :chr_tes
st.src_size 16, 16
st.dest_size 16, 16
st.center_offset 8, 8
st.animation :default do |commands|
commands.loop true
commands.copy_rect :frame => 32, :src => [0, 0]
commands.wait_animation
commands.copy_rect :frame => 32, :src => [1, 0]
commands.wait_animation
end
end