Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-20-2013, 01:04 AM
baseman101 baseman101 is offline
Scripter
baseman101's Avatar
Join Date: Nov 2012
Location: Purcellville, VA
Posts: 76
baseman101 will become famous soon enough
Using Loops to Change GUI Alpha

I am trying to change the alpha of a tool on a staff tool bar I made for a UC server, so I used a for loop to do so. Originally, doing this would work:
PHP Code:
DoctorStaffBar_Control0.alpha 0.3;
DoctorStaffBar_Control1.alpha 0.3;
DoctorStaffBar_Control2.alpha 1;
DoctorStaffBar_Control3.alpha 0.3;
etc
Although my code got really long. So, I made a for loop and added a continue so that if the code got to the staff tool selected, the alpha would become 1. What's odd is that I echoed the code after I set the alpha, and it prints correctly. It doesn't show up on my GUI though. Yes, setting the text does work with this loop.
PHP Code:
function selectToolName(temp.staffCode) {
  
temp.code 0;
  for (
temp.blah getTools()) {
    if (
temp.code == temp.staffCode) {
      
temp.thing "DoctorStaffBar_Control" temp.staffCode;
      
DoctorStaffBar_Control_Text.text getTools()[temp.staffCode][0];
      
temp.thing.alpha 1;
      
temp.code++;
      continue;
    }
    
temp.thing "DoctorStaffBar_Control" temp.code;
    
temp.thing.alpha 0.3;
    
temp.code++;
  }

Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:15 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.