N1kS Posted December 10, 2014 Posted December 10, 2014 (edited) Hello guys! I want to produce my Dx library. Small example: local Rectangle, Text addCommandHandler( "create", function() showCursor(true) -- Creating rectangle Rectangle = Dx:createRectangle ( 0, 0, 300, 300, { 255, 255, 255 }, 150, false ); -- Set rectangle position at the center of the screen Rectangle:setPosition( "center", "center" ); -- Creating some text in the center of the rectangle local RectangleWidth = Rectangle:getWidth() local RectangleHeight = Rectangle:getHeight() Text = Dx:createText( "DxDrawing lib works good!", 0, 0, RectangleWidth, RectangleHeight, { 255, 0, 0 }, 255, 1, "default-bold", "center", "center", false, false, false, Rectangle ); -- Do some events for Rectangle -- On clicking on the rectangle Rectangle.OnClick = function( Button, State, X, Y ) outputChatBox( "You clicked on the rectangle!" ); outputChatBox( "Button: "..Button..", state: "..State ); end -- On mouse enter on rectangle Rectangle.OnMouseEnter = function() outputChatBox( "You entered mouse to rectangle!" ); end -- On mouse leave from rectangle Rectangle.OnMouseLeave = function() outputChatBox( "You leaved mouse from rectangle!" ); end end ) addCommandHandler ("destroy", function() -- Destroy rectangle and all childs! Rectangle:destroy(); end ) Download and get acquainted with the syntax you can in the my repo. I hope that someone might find this resource necessary. Thanks for attention. Repository link: https://github.com/niks123123/DxDrawing Edited December 10, 2014 by Guest skype: shadow_niks
Kenix Posted December 10, 2014 Posted December 10, 2014 Keep it up. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
MTA Team 0xCiBeR Posted December 10, 2014 MTA Team Posted December 10, 2014 Nice work! Keep it up! DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp
Anubhav Posted December 10, 2014 Posted December 10, 2014 Thanks alot, this will make my work 100x easier. BTW: How to install this? This is my first OOP library :3 See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
N1kS Posted December 11, 2014 Author Posted December 11, 2014 Just copy all files to your resource and include them in the meta.xml. skype: shadow_niks
Banex Posted December 11, 2014 Posted December 11, 2014 good job Not worry about the future. Very soon it will come.
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