Hi,
I recently inherited some code that uses NGUI and I am unfamiliar with NGUI.
There is an issue that is occurring after the upgrade from 2.7 to 3.6 with the size of a sprite.
I’ve looked through the upgrade videos,on-line info and it looks like all the upgade changes for UISlicedSprite to UISprite have been previous done in the code.
The problem is with the sprite “Highlight” from the SciFi Atlas. In the code the highlight sprite is adjusted to a 4:3 ratio and scaled larger or smaller depending on the user input.
Currently the sprite appears extremely large and is not visible in the game screen. localScale does not appear to work for the sprite after the upgade. What is the correct way to solve this upgrade issue with sprite sizes so they appear and scale as they did in NGUI 2.7? Below is the basic code that worked in 2.7.
public UISprite BoxObject;
// Normalized box size (4 * boxScale = box width in pixels; 3 * boxScale = box height in pixels)
private float boxScale =17F;
…
newScale = Vector3.one;
newScale.x = Mathf.Clamp(boxScale * 4.0f, 68.0f, 400.0f); // 4:3 ratio
newScale.y = Mathf.Clamp(boxScale * 3.0f, 51.0f, 300.0f);
boxObject.transform.localScale = newScale;
Thank you.