Am 28.04.2009, 18:14 Uhr, schrieb Christopher Barker  
<[email protected]>:

> Ah, so this is FC2 -- same thinks apply, really. Except:
>
> Matt, can the main buffer be a an alpha bitmap, and then you could set
> the background color to transparent, and do the wx.EVT_ERASE_BACKGROUND
> trick?

Yes. At least in theory. In pratice there was this problem where I could  
not clear the alpha channel fast enough (only way was pixel-by-pixel).  
Robin mentioned they worked on this, but I can't find the mail about this  
anymore... I vaguely seem to recall either you could pass an alpha  
parameter somewhere or you can create an empty bitmap from scratch with  
alpha = 0.

I've worked on the original problem today though. A nice side effect of  
this is screen spaced sized objects, i.e. fonts stay the same size on  
screen no matter what the camera zoom factor is. You can also keep  
position and/or rotation fixed in addition to the scale. Very useful for  
labels.

The current solution basically uses a fixed screen space bitmap which you  
can use as the background.

Additionally I've created a small demo showing how to customize the  
default gui modes. The demo shows how to change the "move node" mode so it  
first checks whether the node has a .moveable attribute and if it is  
False, it is not moved.

The custom GUI modes can be used to solve the problem that you can select  
and click the background picture (just filter out the background nodes).

However, all of this seems pretty heavy just to display a simple  
background bitmap :-) So a different solution I was pondering is to have  
two canvasses. One is for real 2d drawing, the other canvas works like the  
current one. You'd just have to make sure the screen space canvas (for the  
background pic) is drawn before the regular one.

I also found a bug with spatial queries, i.e. some objects get rendered  
twice. This has consequences on rendering order of groups and their  
children as well. That's
what I am going to fix next.

Seems like I'm not going to make the final SVN checkin today, I hope this  
stuff is ready by tomorrow. The SVN update will come with a ready-to-use  
sample for the background bitmap problem.

-Matthias

P.S.: Since the canvas is just a node by itself it might be possible to  
make a root node and add e.g. a screen space and a regular canvas to this  
root node. Allows you to use canvasses just like regular nodes, change  
their front/back properties, move them around etc..
_______________________________________________
FloatCanvas mailing list
[email protected]
http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to