The widget in the 3D scene

View previous topic View next topic Go down

The widget in the 3D scene

Post  Yogan on 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

View user profile

Back to top Go down

Re: The widget in the 3D scene

Post  sio2interactive on 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

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

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

View user profile http://sio2interactive.com

Back to top Go down

Re: The widget in the 3D scene

Post  Yogan on Wed May 06, 2009 11:12 pm

I turned off but it did not help...

Yogan

Posts : 6
Join date : 2009-04-27

View user profile

Back to top Go down

Re: The widget in the 3D scene

Post  sio2interactive on Thu May 07, 2009 12:17 am

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

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

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

View user profile http://sio2interactive.com

Back to top Go down

Re: The widget in the 3D scene

Post  Yogan on Thu May 07, 2009 2:06 am

Thnx...

Yogan

Posts : 6
Join date : 2009-04-27

View user profile

Back to top Go down

Re: The widget in the 3D scene

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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