Skip to content

Instantly share code, notes, and snippets.

@shinokaro
Last active January 1, 2016 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shinokaro/8078175 to your computer and use it in GitHub Desktop.
Save shinokaro/8078175 to your computer and use it in GitHub Desktop.
require "dxruby"
f = Fiber.new do
loop do
8.times do
Fiber.yield 0 # alpha 透明度, 0は透明。試すなら128(半透明)が分かりやすい
Fiber.yield 255 # red
Fiber.yield 0 # green
Fiber.yield 0 # blue
end
8.times do
Fiber.yield 255
Fiber.yield 0
Fiber.yield 255
Fiber.yield 0
end
end
end
ary = Array.new(32 * 32 * 4){ f.resume}
image = Image.createFromArray(32, 32, ary)
Window.loop{Window.draw(0,0,image)} #これは無限ループ
image.save("C:\\test.PNG")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment