c# - Unity3D/NGUI UI elements drawn at wrong location -


i have curious problem rendering actual content in ngui widgets when underlying panel moved. reason, content doesn't update correct position if bounds are. first image how should , second how after moving underlying panel right left. can see widget rectangles in correct place contents (text or sprite) misplaced.

i have tried updating, refreshing anchors etc. none seem working. ideas? seems rendering problem. using unity 4.6 , ngui 3.7.4 currently.

ok not ok

i suppose ngui don't work (parent) gameobject being inactive. if try uiscrollview.resetposition, scaling or re-positioning.

so have extension this

public static void resetpositionhack(this uiscrollview scrollview, float animlength = 1f ) {     scrollview.resetposition();     scrollview.currentmomentum = vector3.zero;     keepmakingdirty.begin( scrollview, animlength ); } 

the method keepmakingdirty.begin attach monobehavior object (also make sure no double attachment).
setdirty() called in it's update() specified period of time.
script self-destructs.


Comments