Encapsulate lines inside a panel and move that panel?
Posted: Fri Nov 13, 2015 11:29 am
I'm trying to do an animation in Flowstone using Ruby. What I'd like to do is to draw some lines/points inside a "panel" (Bitmap?) and than moving it left or right, adding new lines/points later and get a unique panel movement. A sort of "sweep/transition" of points.
I guess there is a smart way instead of store each lines inside an array and at each event, redraw all lines, translated of x value: when I got many points, this will be a NxM iteration.
This is what I have for example:
but I have no idea how to encapsulate these lines inside the hypothetical Bitmap and move it later.
Any clues?
Thank you!
I guess there is a smart way instead of store each lines inside an array and at each event, redraw all lines, translated of x value: when I got many points, this will be a NxM iteration.
This is what I have for example:
Code: Select all
def draw v
p = Pen.new (Color.new 200,0,200,0), 0.3
v.drawBitmap @bitmap,"[0,0,50,50]"
v.drawLine p, [10, 10],[20, 10]
v.drawLine p, [10, 15],[20, 15]
end
def event i,v
if(i == "trigger")
redraw 0
end
end
but I have no idea how to encapsulate these lines inside the hypothetical Bitmap and move it later.
Any clues?
Thank you!