FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

The widget in the 3D scene

2 posters

Go down

The widget in the 3D scene Empty The widget in the 3D scene

Post  Yogan Wed May 06, 2009 6:00 am

I draw 3D scene and I have to draw the 2D button over 3D scene.

LOAD
Code:

//2D
   SIO2stream *_SIO2stream = sio2StreamOpen( "checkerplate.png", 1 );
   
   if (_SIO2stream != NULL)
   {
   
   _SIO2widget    = sio2WidgetInit  ( "button" );
   _SIO2material  = sio2MaterialInit( "button" );
   _SIO2image      = sio2ImageInit  ( "button" );
   
   sio2ImageLoad( _SIO2image, _SIO2stream );
   sio2ImageGenId( _SIO2image, 0, 0.0f );
   
   _SIO2widget->_SIO2material = _SIO2material;
   _SIO2material->_SIO2image[  SIO2_MATERIAL_CHANNEL0 ] = _SIO2image;
   _SIO2material->blend = SIO2_MATERIAL_ALPHA;
   
   _SIO2widget->_SIO2transform->scl->x = _SIO2image->width;
   _SIO2widget->_SIO2transform->scl->y = _SIO2image->height;
   
   _SIO2widget->_SIO2transform->loc->x = 20.0f;
   _SIO2widget->_SIO2transform->loc->y = 20.0f;
   
   _SIO2stream = sio2StreamClose( _SIO2stream );
   }


DRAW
Code:

if (_SIO2widget != NULL)
   {
      sio2WindowEnter2D( sio2->_SIO2window, 0.0f, 100.0f );
      {
         sio2WidgetRender( _SIO2widget, sio2->_SIO2window, 0 );
      }
      sio2WindowLeave2D();
   }

It is crashed when call sio2WidgetRender( _SIO2widget, sio2->_SIO2window, 0 );
Can I draw the widget in the 3D scene?

Yogan

Posts : 6
Join date : 2009-04-27

Back to top Go down

The widget in the 3D scene Empty Re: The widget in the 3D scene

Post  sio2interactive Wed May 06, 2009 9:45 am

To answer that question again...have you turned off png compression in the project settings of Xcode? Wink
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

The widget in the 3D scene Empty Re: The widget in the 3D scene

Post  Yogan Wed May 06, 2009 11:12 pm

I turned off but it did not help...

Yogan

Posts : 6
Join date : 2009-04-27

Back to top Go down

The widget in the 3D scene Empty Re: The widget in the 3D scene

Post  sio2interactive Thu May 07, 2009 12:17 am

Heuuuu dude have you initialized the widget system? sio2WidgetInit... check tutorial07
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

The widget in the 3D scene Empty Re: The widget in the 3D scene

Post  Yogan Thu May 07, 2009 2:06 am

Thnx...

Yogan

Posts : 6
Join date : 2009-04-27

Back to top Go down

The widget in the 3D scene Empty Re: The widget in the 3D scene

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum