Author Topic: Manual refresh of UIPanel?  (Read 2362 times)

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Manual refresh of UIPanel?
« on: June 13, 2012, 05:52:20 AM »
Ok, this is a problem that can be solved in about 5 seconds in one line of code. Just trying to find that particular code.

I have a draggable UIPanel with buttons in it, as I drag back and forth everything works ok. I have a cursor in my slider which highlights a button when I click on it.

The problem I have is that when I click a new button, the graphic does not update unless I drag the panel again, even though nothing is set to static. Basically what I am looking for is something like this.

MyNGUIObj.RefreshUILabel();

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Manual refresh of UIPanel?
« Reply #1 on: June 13, 2012, 07:08:18 AM »
Just to be sure:

You click button A and A highlights fine. You click button B, which should highlight button B and "de-highlight" button A?


Anyways, you can call the panel's refresh.

  1. myWidget.panel.refresh();

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: Manual refresh of UIPanel?
« Reply #2 on: June 13, 2012, 10:10:18 PM »
Hi Nicki,

Well I have no idea where to find this "refresh()" function. I have tried getting components and looking everywhere. Such as UIPanel, UISprite, UIWidget, UIAnchor etc.

I can get at .panel in most objects but there is no hint of a refresh function.

BTW I have all my button highlighting stuff all working already. It is just that nothing is being refreshing until I drag the UIPanel.

PhilipC

  • Guest
Re: Manual refresh of UIPanel?
« Reply #3 on: June 14, 2012, 08:29:10 AM »
You could also try to mark the object as changed (MarkAsChanged()).

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: Manual refresh of UIPanel?
« Reply #4 on: June 14, 2012, 09:41:19 PM »
By the way, an update. (I forgot about this thread)

Suddenly my gfx of the UISlider came out corrupted, everything turned into squares, I couldn't figure that problem out either. So I rebooted my PC and guess what? All my problems were magically solved?!.... so in the end I didn't even need the refresh option. Everything is working ok now.

Have no idea what was going on there.