Last active
January 1, 2016 02:19
-
-
Save shinokaro/8078175 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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