Skip to content

Instantly share code, notes, and snippets.

@t-tutiya
Created Dec 18, 2016
Embed
What would you like to do?
#! ruby -E utf-8
_TEXT_BUTTON_ text: "右", out_color: [0,255,255], #カーソルがボタン外にある時の背景色
in_color: [255,255,0] do
#キーがクリックされた
_DEFINE_ :on_key_push do
_SEND_ [:bg] do
_SET_ bgcolor: [255,0,0]
end
_SEND_ [:_ROOT_, :target] do
_PUTS_ "*************************************"
_DEBUG_COMMAND_
_GET_ [:x, :y] do |x:, y:|
_MOVE_ [120, :out_quart], x:[x, x + 60]
end
end
end
end
_TEXT_BUTTON_ text: "左", y:32, out_color: [0,255,255], #カーソルがボタン外にある時の背景色
in_color: [255,255,0] do
#キーがクリックされた
_DEFINE_ :on_key_push do
_SEND_ [:bg] do
_SET_ bgcolor: [255,0,0]
end
_SEND_ [:_ROOT_, :target] do
_PUTS_ "*************************************"
_DEBUG_COMMAND_
_GET_ [:x, :y] do |x:, y:|
_MOVE_ [120, :out_quart], x:[x, x - 60]
end
end
end
end
_TEXT_BUTTON_ text: "下", y:64, out_color: [0,255,255], #カーソルがボタン外にある時の背景色
in_color: [255,255,0] do
#キーがクリックされた
_DEFINE_ :on_key_push do
_SEND_ [:bg] do
_SET_ bgcolor: [255,0,0]
end
_SEND_ [:_ROOT_, :target] do
_PUTS_ "*************************************"
_DEBUG_COMMAND_
_GET_ [:x, :y] do |x:, y:|
_MOVE_ [120, :out_quart], y:[y, y + 60]
end
end
end
end
_TEXT_BUTTON_ text: "上", y:96, out_color: [0,255,255], #カーソルがボタン外にある時の背景色
in_color: [255,255,0] do
#キーがクリックされた
_DEFINE_ :on_key_push do
_SEND_ [:bg] do
_SET_ bgcolor: [255,0,0]
end
_SEND_ [:_ROOT_, :target] do
_PUTS_ "*************************************"
_DEBUG_COMMAND_
_GET_ [:x, :y] do |x:, y:|
_MOVE_ [120, :out_quart], y:[y, y - 60]
end
end
end
end
_CREATE_ :Layout, id: :target,x:300, y:300, width:100, height:100 do
_CREATE_ :Image, id: :sikaku, width:100, height:100, color:[255, 255, 0] do
_DEFINE_PROPERTY_ arrow: -1
_SET_ center_x: nil, center_y: nil
_DEFINE_ :rotate do
_GET_ [:arrow, :angle] do |arrow:, angle:|
_MOVE_ 240, angle:[angle,(360 - angle)*arrow]
end
_RETURN_ do
rotate
end
end
rotate
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment