Hello Guest

Author Topic: tk2DCameraAnchor question  (Read 4876 times)

fsadeq

  • 2D Toolkit
  • Sr. Member
  • *
  • Posts: 353
    • View Profile
tk2DCameraAnchor question
« on: June 19, 2012, 06:19:55 pm »
Hello, I was wondering if there could be some alternate version of tk2CameraAnchor where an UpdateTransform isn't needed every frame. I don't have any elements in my GUI that require constant updating and this seems like a waste of calculations, especially when I have several anchors. Is this possible, short of just extending the main class?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2DCameraAnchor question
« Reply #1 on: June 19, 2012, 11:39:59 pm »
Extending it / commenting it out Update() might be the easiest thing to do - if you're concerned about those calculations you might as well not call update at all.

coshea

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: tk2DCameraAnchor question
« Reply #2 on: January 30, 2014, 10:19:00 am »
I was wondering about this too, a google search led me here.

Perhaps the tk2dCameraAnchor could have a tick box option of update at runtime that you can disable?

I only need to update my anchors once at the start based on the camera dimensions, not every frame.


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2DCameraAnchor question
« Reply #3 on: January 30, 2014, 10:39:02 am »
I'm not sure that would be a good idea, it could end up causing a lot of confusion on why things stopped working. You could just attach a script that turns it off after a frame though? A coroutine start would do the job.

The computations in there are pretty trivial and shouldn't even be noticeable unless you have a huge number of them - how many anchors do you have?