On Mon, 2011-05-23 at 19:02 +0200, daniele argiolas wrote:
> Hi,
> is there a way to put a semitransparent image in a widget?
>
> I build my widget as:
>
>
> Code:
>
> widget = new osgWidget::Widget(imageSrc,notifySize[0],notifySize[1]);
> widget->setColor(1.0,1.0,1.0,1.0);
> widget->setImage(imageSrc);
> widget->setSize(notifySize);
> widget->setTexCoord(0.0f, 0.0f, osgWidget::Widget::LOWER_LEFT);
> widget->setTexCoord(1.0f, 0.0f, osgWidget::Widget::LOWER_RIGHT);
> widget->setTexCoord(1.0f, 1.0f, osgWidget::Widget::UPPER_RIGHT);
> widget->setTexCoord(0.0f, 1.0f, osgWidget::Widget::UPPER_LEFT);
> widget->setAlignHorizontal(osgWidget::Widget::HA_CENTER);
> widget->setAlignVertical(osgWidget::Widget::VA_CENTER);
> widget->setLayer(osgWidget::Widget::LAYER_TOP );
I should also mention that if you call:
->setImage(imageSrc, true)
...you will not need to manually call setTexCoord().
> imageSrc is a PNG transparent file, but I can't see the trasparence.
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=39637#39637
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org