fsdfdsf Posted January 29, 2015 Share Posted January 29, 2015 how can i make rectangle press ( button)? my code, i want my rectangles to press? local x,y = guiGetScreenSize() function panel() showChat( false ) showCursor( true ) dxDrawRectangle ( x/4, y/3.8, x/4, y/2, tocolor ( 255, 0, 0, 100 ) ) dxDrawRectangle ( x/1.92, y/3.8, x/4, y/2, tocolor ( 0, 255, 0, 100 ) ) end addEventHandler ( "onClientRender", getRootElement(), panel) Link to comment
Moderators IIYAMA Posted January 29, 2015 Moderators Share Posted January 29, 2015 For you as beginner, I would recommend you to create a gui button and make it invisible on top of your rectangles. https://wiki.multitheftauto.com/wiki/GuiCreateButton https://wiki.multitheftauto.com/wiki/GuiSetVisible When you are getting better at lua, you can start learning new and cleaner techniques. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now