Jump to content

?? Need help


Zinjaaa

Recommended Posts

Posted

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

Posted

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

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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)

Posted

The links I gave you got examples, you obviously didn't even open them, what you want is to get it done.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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);  
  
  

there are two kinds of people: those who know C++ and those who don´t. .)

Posted

Exactly what I said, you just wanted it done.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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

there are two kinds of people: those who know C++ and those who don´t. .)

Posted
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! )

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

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...