Game Development Community

custom scenegraph will not sit in portrait (solved)

by rennie moffat · in iTorque 2D · 05/18/2011 (11:37 am) · 7 replies

Hi there,
I have two scenegraphs, sceneWindow2D and otherScenegraph. I layer otherScenegraph on top of sceneWindow2D. Problem is, despite having identical parameters, otherScenegraph is stretched horizontally, appearing to set in landscape. As well, to add insult to injury, all sprites in otherScenegraph appear stretched horizontally. I did a calculation and they are stretched in proportion to being in a landscape environment.

A temp fix was to adjust the sprites in otherScenegraph sizes so as to give them the appearance of normality but placement was a "b" since the otherSceneGraph lowest, bottom edge is 2/3's up the middle of the scene window.


I posted on this earlier and talked to Michael about it briefly but nothing was resolved. I am wondering if anyone else has had a similar issue and or, has anyone layered scenegraphs in 1.4.1 without hassle.





//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(mainScreenGui) {
   canSaveDynamicFields = "0";
   isContainer = "1";
   Profile = "GuiDefaultProfile";
   HorizSizing = "width";
   VertSizing = "height";
   Position = "0 0";
   Extent = "480 320";
   MinExtent = "480 320";
   canSave = "1";
   Visible = "1";
   hovertime = "1000";

   new t2dSceneWindow(sceneWindow2D) {
      canSaveDynamicFields = "0";
      isContainer = "0";
      Profile = "GuiDefaultProfile";
      HorizSizing = "width";
      VertSizing = "height";
      Position = "0 0";
      Extent = "480 320";
      MinExtent = "480 320";
      canSave = "1";
      Visible = "1";
      tooltipprofile = "GuiDefaultProfile";
      hovertime = "1000";
      lockMouse = "0";
      useWindowMouseEvents = "1";
      useObjectMouseEvents = "1";
   };
   new t2dSceneWindow(otherScenegraph) {
      canSaveDynamicFields = "0";
      isContainer = "0";
      Profile = "GuiDefaultProfile";
      HorizSizing = "width";
      VertSizing = "height";
      Position = "0 0";
      Extent = "480 320";
      MinExtent = "480 320";
      canSave = "1";
      Visible = "1";
      tooltipprofile = "GuiDefaultProfile";
      hovertime = "1000";
      lockMouse = "0";
      useWindowMouseEvents = "1";
      useObjectMouseEvents = "1";
   };
   

};
//--- OBJECT WRITE END ---

About the author

My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.


#1
05/22/2011 (7:45 am)
Anyone? If you have done this same method with good results I would like to know. Thanks.
#2
05/22/2011 (7:45 am)
Anyone? If you have done this same method with good results I would like to know. Thanks.
#3
05/22/2011 (2:15 pm)
I have a question for you.
How can I manage to set an actor for a single scene so if I, for example, hide "otherScene" only objects from this scene will be hidden?
#4
05/22/2011 (3:03 pm)
I would just use globals. So I use behaviors. So I would make ....

///in otherScene
{
	$otherOwner = %this.owner;
}



Then I can call $otherOwner from anywhere in any scene.

#5
05/22/2011 (4:25 pm)
Not really a wonder it won't work, as you set the extends to landscape, not portrait (480 320 instead of 320 480). For the default one, if I recall right, there is code to correct that but your own will just do what you told it to do
#6
05/22/2011 (4:34 pm)
Yes. I had played with that tho also, the project is set to and is displayed, so mainScreen.gui and sceneWindow2D appear in portrait. Oh well, I believe I have tested that too. Will try again tomorrow.

Thanks
#7
05/23/2011 (8:03 am)
So Marc, I just swapped out all 480x320 for 320x480 in the main screen gui and its window. However, when I do so, tho it looks normal, all my mouse commands vanish. They are no longer in use. They return no echos nor perform any functions.


What is this about iTourque!!??!




#8
05/25/2011 (12:47 pm)
Ok.
It makes no sense but when I have a project, that is portrait, my mainScreenGui and sceneWindow2D are 480 x 320 according to the gui. If I add in a new window tho it must be reversed to 320 x 480. Not sure why are all not 320 x 480. But there it is.

Ps. I thought I had tried that so sorry for bothering the board.