Jump to content

texture and resize HUD help please


Even Genesis
 Share

You are about to reply to a thread that has been inactive for 1325 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I'm making this texture HUD and I'd like to also embed a resizer. What I did sorta works,

BUT after I click on the resize buttons a bunch of times, I realized it applies the scaling but I don't see the changes on the mesh - unless I right click on the mesh itself.

So the script works, but I don't want to have to "right click" to see the changes.

I'm pretty sure it has to do with my code (I'm not good at this...), so any help is appreciated here to fix this... Thank you!

This is what I put inside the object:

integer textchann = -44444555;
string cloth_name = "objectname";

default{
    state_entry(){
        llListen (textchann,"","","");
    }

   listen(integer channel, string name, key id, string msg){
        if (llGetOwnerKey(id) == llGetOwner()){
            list lst = llParseString2List(msg,["|"],[""]);
            string tex = llList2String(lst,0);
            string msg = llList2String(lst,1);
            string hud_cloth_name = llList2String(lst,2);
                                   
                       
               if (cloth_name == hud_cloth_name) {        
                  
                if ( msg == "scaleup" ){
      			  llScaleByFactor(1.1);
 					}
          
                 else if ( msg == "scaledown" ){
 					llScaleByFactor(0.9);
  					 }
                
               else  if (cloth_name == hud_cloth_name) {        
            llSetTexture(llList2String(lst,0),llList2Integer(lst,1));
                       } 
                             
                           
        }
        }
    }
}

 

Link to comment
Share on other sites

is nothing wrong with the script that I can see as wrote. Altho you might want to check llGetMinScaleFactor and llGetMaxScaleFactor http://wiki.secondlife.com/wiki/LlGetMinScaleFactor

your issue tho seems to be that your viewer is not updating/scaling the object immediately onscreen as it should. Suggest that you try it on a different region. And also try it on a different viewer. Either or both may give you a better insight into whether or not it is a viewer/region issue

 

Link to comment
Share on other sites

Um what is on the Hud  is it just an image this is what I use with code to read the click position of the face this seems to scale without any problem at all or with your code 

touch_start(integer total_number)
    {
       integer indexno = 0;
    
            gGetKey = llDetectedKey(0);
            key group_key = llList2Key(llGetObjectDetails(llGetLinkKey(LINK_ROOT), [OBJECT_GROUP]), 0);
            key owner_key =  llGetOwner();
            integer link = llDetectedLinkNumber(0);
            integer face = llDetectedTouchFace(0);
             if (face == TOUCH_INVALID_FACE) {
                  llShout(PUBLIC_CHANNEL, "Sorry, your viewer doesn't support touched faces.");
                    return;
             }
            if( run_mode_owner_only && owner_key != gGetKey) return;
            if(run_mode_group_only &&  llSameGroup(gGetKey) == FALSE) return;
                      
            integer iRows = 30;
            integer iCols = 11;
            vector  vST = llDetectedTouchST(0);
            integer iButton = ((integer)llFloor(vST.y*iRows))*iCols + (integer)llCeil(vST.x*iCols

Working out a simple columnar buttons array you can get the values covered by your buttons as its a jpg on the face it will scale wonderfully 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1325 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...