playMaker

Author Topic: Rounding Floats to Ints - multiples of 2[SOLVED]  (Read 2620 times)

jess84

  • Hero Member
  • *****
  • Posts: 515
Rounding Floats to Ints - multiples of 2[SOLVED]
« on: April 24, 2014, 09:43:27 PM »
Hi,

Would it be possible to have an additional option on the Convert Float To Int action, to round to the nearest multiple of 2?

Or a seperate action to take an Int and round it to a multiple of 2?

(I'm getting values for GUI items based on screen width, and rounding - but that often leads to my textures being sized to a non power of 2).

Cheers,
« Last Edit: April 28, 2014, 02:04:24 PM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Rounding Floats to Ints - multiples of 2
« Reply #1 on: April 28, 2014, 06:11:09 AM »
Hi,

Ok, get it here for now:

GetNearestPowerOfTwo

The ecosystem browser is only a matter of one or two day before first release, then you'll be able to get it within Unity editor.


bye,

 Jean

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Rounding Floats to Ints - multiples of 2
« Reply #2 on: April 28, 2014, 10:28:32 AM »
Thanks!