Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualBrother Bob

Posted 22 July 2013 - 12:24 PM

By putting the following code in the Render function you are resetting it all to their initial positions every time the frame renders.  This is why I specified that you make moveVertex[] a global variable.  The following should be put in a initization function such as 'ViewDidLoad(), or you could put them in the same place that you put the texture intialization above in the 'calls alloc once' if() loop.  I think the usual 'objective C' way to do things is to put moveVertex[] in the view controller.h.  Personally, I would make it a Global variable.  On a side note, is this an iOS app or Mac?

 

 

//------------------------------------------------------------//MOVE THE FOLLOWING OUT OF THE RENDER OR UPDATE FUNCTIONS TO THE INITIALIZATION FUNCTION

x = (self.texture.width / window.x); y = (self.texture.height / window.y); self.initPositionX = (self.positionX / window.x) * 2; self.initPositionY = (self.positionY / window.y) * 2; xCoord[0] = 0 - x; yCoord[0] = 0 - y; xCoord[1] = 0 + x; yCoord[1] = 0 - y; xCoord[2] = 0 - x; yCoord[2] = 0 + y; xCoord[3] = 0 + x; yCoord[3] = 0 + y;


#2marcClintDion

Posted 22 July 2013 - 03:23 AM

There is far too much arrogance and out right abuse by site moderators, they are teaching other people to behave this way.  The posts I've made will all be shorty removed and replaced with this notice.  Game development is not the only thing being taught here, bad behavior is being taught as well.


#1marcClintDion

Posted 15 June 2013 - 09:08 AM

By putting the following code in the Render function you are resetting it all to their initial positions every time the frame renders.  This is why I specified that you make moveVertex[] a global variable.  The following should be put in a initization function such as 'ViewDidLoad(), or you could put them in the same place that you put the texture intialization above in the 'calls alloc once' if() loop.  I think the usual 'objective C' way to do things is to put moveVertex[] in the view controller.h.  Personally, I would make it a Global variable.  On a side note, is this an iOS app or Mac?

 

 

//------------------------------------------------------------//MOVE THE FOLLOWING OUT OF THE RENDER OR UPDATE FUNCTIONS TO THE INITIALIZATION FUNCTION

x = (self.texture.width / window.x);
y = (self.texture.height / window.y);

self.initPositionX = (self.positionX / window.x) * 2;
self.initPositionY = (self.positionY / window.y) * 2;

xCoord[0] = 0 - x; yCoord[0] = 0 - y;
xCoord[1] = 0 + x; yCoord[1] = 0 - y;
xCoord[2] = 0 - x; yCoord[2] = 0 + y;
xCoord[3] = 0 + x; yCoord[3] = 0 + y;


PARTNERS