Project1

标题: 在脚本中使用像素图(pixel map,并非bitmap) [打印本页]

作者: 晴兰    时间: 2014-9-1 02:19
提示: 作者被禁止或删除 内容自动屏蔽
作者: 紫英晓狼1130    时间: 2014-9-1 06:02
可以尝试一下用其描绘满屏画面,看看执行效率= =
作者: 余烬之中    时间: 2014-9-6 22:05
  1. s = Sprite.new
  2. s.bitmap = Bitmap.new Graphics.width, Graphics.height
  3. s.bitmap.fill_rect s.bitmap.rect, Color.new(255, 255, 255, 255)
  4. x = Bitmap.pixelMap "." => Color.new(255, 155, 225, 255) do
  5.   ",...,,,.,,.,,,.,.,.,,.,.,".each_char.each_slice(5).map{|t|t.join}.join "\n"
  6. end
  7. s.bitmap.blt 1, 1, x, x.rect
  8. s.zoom_x = s.zoom_y = 50
  9. [Graphics, Input, s].each &:update until false
复制代码





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1