Jump to content

?? Need help


Zinjaaa

Recommended Posts

Hello I come here for some help, It turns out that I want to make an effect on my button

And I have no idea how to do

Normal image (Button)

2n0sdok.jpg

Image with effect

And the cursor over the button

34pctj7.jpg

We notice a change if a darker image to a brighter

I need some examples taken from wikipedia

Link to comment
It does help, but you must be willing to read and learn.

Well if you are not able to do a very basic example is not necessary to speak on this topic

I really do not know much about why I prefer wikipedia desire some examples created by itself (I understand that I am a novice but gradually learn)

Link to comment

1ºst way: create two different images and use guiStaticImageLoadImage when "onClientMouseEnter",

"onClientMouseLeave" events are fired. -> bad way. client need to download 2 images from server.

2ºnd way:

change the static image CEGUI property "ImageColours" to make the image a bit darker or brighter,

when "onClientMouseEnter", "onClientMouseLeave" events are fired.

--->

try this -->

  
function blendStaticImageWithColor(guiStaticImage, r,g,b) 
   local __hex = string.format("%X%X%X",r,g,b); 
   guiSetProperty(guiStaticImage, "ImageColours",  
                "tl:" .. __hex .. " tr:" .. __hex ..  
                " bl:" .. __hex .. " br:" .. __hex);  
end;  
  
function make_it_darker(guiStaticImage) 
        blendStaticImageWithColor(guiStaticImage, 155, 155, 155);  
end;  
function make_it_brighter(guiStaticImage)  
        blendStaticImageWithColor(guiStaticImage, 255,255,255);  
end;  
  
addEventHandler("onClientMouseEnter", getRootElement(),  
      function()  
          -- just for static-images.  
         if getElementType(source) ~= "gui-staticimage" then return; end;  
         -- make the static image brighter. 
         make_it_brighter(source);  
      end);  
addEventHandler("onClientMouseLeave", getRootElement(),  
      function()  
          -- just for static-images.  
         if getElementType(source) ~= "gui-staticimage" then return; end;  
          -- make the static image darker. 
          make_it_darker(source);       
      end);  
  
  

Link to comment
yes, you need to read all the answers, search, and do it by yourself. dont´t expect other will do your homework.

then why did you do it? Its oke to give people a script but dont make it fully working. Make a start, like someone wants a command to give players cash? Oke, sure. Give them something like this;

addCommandHandler("giveMoney", 
    function ( source, command, amount ) 
        -- source = the player 
        -- command = the command that has been triggered (giveMoney) 
        -- amount = the amount of money 
         
        -- check if it are numbers with; 
        tonumber 
         
        -- check if the player has money with; 
        getPlayerMoney() 
         
        -- give out the money and remove the amount of money 
        takePlayerMoney() 
        givePlayerMoney() 
    end 
); 

they would learn alot more then just getting scripts, turning them on and taking all the credits for it. ( and yes, thats out of experience. I also learned it that way! )

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...