pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trixt0r <trixte...@web.de>
Subject Re: Drawing a display on top of a canvas
Date Tue, 04 Mar 2014 12:20:30 GMT
Roger and Beth Whitcomb wrote
> What happens if you set the backgroundColor style to null (in BXML it 
> would be $bxml:null)?
> ~Roger

Thanks for the reply.
Setting the background color to null makes no difference.
Anyway, I figured out how to draw a Pivot GUI above a java.awt.Canvas.

For anyone who is going to have the same problems:
First of all, you have to override the paint method of
ApplicationContext.DisplayHost displayHost = new
        	         public void paint(Graphics g){
So instead of painting the display, you print it.
Then put this displayHost into a JPanel. Set the JPanel's opaque property to
false (jpanel.setOpaque(false)) 
and set the dislplay background transparent
(displayHost.getDisplay().getStyles().put("backgroundColor", new

To draw your canvas behind the Pivot GUI you have to create another JPanel
and override its paint method:
public void paint(Graphics g){ yourCanvas.paint(g);}

Then you can add your both JPanels to a JFrame or to another JContainer.

My problem is now, that my canvas, which draws OpenGL stuff, only draws its
background and not the actual content. But that is not your problem, so I am
going to ask this in the Libgdx forum.

- Trixt0r

View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Drawing-a-display-on-top-of-a-canvas-tp4022892p4022894.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

View raw message