Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Bitmap
- def creat_ligne(x_1,y_1,x_2,y_2)
- largeur_rec = x_2 - x_1
- longeur_rec = y_2 - y_1
- distance = Math.sqrt(largeur_rec**2 + longeur_rec**2)
- largest_dis = largeur_rec if largeur_rec >= longeur_rec
- largest_dis = longeur_rec if longeur_rec >= largeur_rec
- for i in 0..distance
- x = (x_1 + (largeur_rec*i)/distance)
- y = (y_1 + (longeur_rec*i)/distance)
- color = Color.new(0, 0, 0, 255)
- self.set_pixel(x, y, color)
- end
- end
- end
- #===============================================================================
- class Scene_design < Scene_Base
- def start
- @window = Window_Base.new(50,50,200,200)
- @window.contents.creat_ligne(0,0,150,0)
- @window.contents.creat_ligne(0,0,0,150)
- @window.contents.creat_ligne(0,150,150,150)
- @window.contents.creat_ligne(150,0,150,150)
- @window.contents.creat_ligne(150,0,0,150)
- @window.contents.creat_ligne(0,0,150,150)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement