|
|
|
Junior Member
      
Group: Forum Members
Last Login: 10/6/2008 9:19:56 AM
Posts: 13,
Visits: 40
|
|
we have two solid circles, let's say in two opposite corners. Another smaller circle is moving from one to the other, simulating a uniform rectolinear motion.
What is the best approach to achive this?
what about something like: 1) draw a circle at X+1,Y+1, wait 100ms, draw the same circle with fillcolor=background, go back to 1) ?
How can use the spriteanimation example you gave on the web site to move such circle? I think there is a problem to the fact that the sprite routine cuts rectangle of screen so, if I cut a rectangle around my moving circle I cut also the background, so if the circle (now rectangle) is moving inside the circle in the corner, I see a different background.
Am I wrong?
thanks.
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: Yesterday @ 4:03:21 PM
Posts: 34,
Visits: 153
|
|
You are correct that the sprite example (or any use of canvas copying) uses a rectangle as the area of screen to load.
In the sprite animation example however, a color key is used to indicate that the background of the source is to be transparent.
What this means is that you can create a bitmap image of your circle with a specific (unwanted) color in the background. A "pure" color works best (red, blue, green, white, black). You can then specify this color as the key, and eprime will display the image with that color cut out.
One thing to be careful of is that some image editing software will dither or blur the edges in your images, especially when saving as a jpeg. E-prime does not (as far as I know) support multiple levels of transparency, so if your shape has a blurry edge, the unwanted color will show up on the border of the shape. To avoid this, make sure you are working with bitmaps, and your shapes are drawn from vectors, not brushes or resized pixels from another image. The down side of this is that circles will have rough, jagged edges.
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 10/6/2008 9:19:56 AM
Posts: 13,
Visits: 40
|
|
RedTurtle (9/5/2008) You are correct that the sprite example (or any use of canvas copying) uses a rectangle as the area of screen to load.
In the sprite animation example however, a color key is used to indicate that the background of the source is to be transparent.
cool, this works fine! I have another question:
The circle moves following a path, let's say to x,y then to x1,y1 then to x2,y2 etc.. each step corresponds to a image. So when the circle is above the one shown at x1,y1 we change direction. Now, instead of using fixed coordinates that need to be set and calculated each time, I thought that using a Slide+SildeImages would be a better choice. So my question is: is it possible to attach tha moving circle canvas to a Slide?
Now I am doing this:
- create a Slide+slideImages, black background and four solid red circles at the corner
- create a cnvScreen which holds the screen
- create a moving blue circle with cnvsCircle.circle X,Y,radius and a rectangular which includes it and a destRect
- create a cnvsBackground where I copy the image shown by Slide+slideImages
- loop this: --> clear cnvScreen, copy the cnvsBackground to cnvScreen, copy the cnvsCircle, increment destRect <--
this works but I have a white background even I copied the black one in the 4th step, I have a trail from the starting point to the end like this ((((((((((((((((((((( )
thanks
|
|
|
|