Real Software Forums
http://forums.realsoftware.com/

canvas control
http://forums.realsoftware.com/viewtopic.php?f=4&t=33563
Page 1 of 1

Author:  Boomshiki [ Tue Apr 27, 2010 5:26 pm ]
Post subject:  canvas control

Just messing around, trying to get the feel for RealBASIC, I threw together a few images and cycle through them to animate a guy walking around the screen. My only roadblock right now is that I can't figure out how to set the transparency in the canvas. My little guy is doomed to forever walk around in a white square. I read that the call is transparency=1 but I can't get it to go.

Quote:
canvas1.backdrop = cloudstep1front
canvas1.backdrop.transparent=1


That's how I've put it on one of my frames, but I still get the white square. I feel like I am totally missing the mark here.

[nvm, I was being dumb and put it in my if checks and expected it to work. It's all fine now. I guess this can be deleted]

Author:  DaveS [ Tue Apr 27, 2010 7:10 pm ]
Post subject:  Re: canvas control

You should use ONE canvas... and ONE PICTURE

use the Picture to Draw you Figure [without any background... ie make the background WHITE]...

Then in the CANVAS PAINTEVENT.... draw your picture


g.drawpicture stickfigure_picture,x,y

You can make an array of pictures with each one being an animation frame, and cycle them across the canvas .. this way you only have to calculate and draw each version one time.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/