Jump to content

Clicking on streamed images


Wes

Recommended Posts

I want to put images in the MTA server, is there any function with I can trigger an event if the user clicks on the picture? Like onClientGUIClick, but instead of a gui button, you have to click on an image

Link to comment
  • Moderators

or onClientClick

https://wiki.multitheftauto.com/wiki/OnClientClick

You can use that for clicking at directx render images or specific locations.

compare the image start size and the image end size with the absoluteX and absoluteY value.

  
local Xstart, Ystart = 100,100 
local Xend,Yend = Xstart+100, Ystart+100 
  
addEventHandler ("onClienClick",root, 
function (button, state,absoluteX, absoluteY )  
if (absoluteX > Xstart and absoluteX < Xend) and (absoluteY > Ystart and absoluteY < Yend) then 
outputChatBox("clicked on the image") 
end 
end) 

Link to comment

So yea, if his cursor is over the image, doesnt click but it stands there, then it changes the picture. I want so when he hovers his mouse over the image, it changes into another button that has a border. The only thing I ask now is how can I make it so it will change the picture

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