Skip to content

Instantly share code, notes, and snippets.

@shinokaro
Last active Jan 1, 2016
Embed
What would you like to do?
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