NeXTreme Posted April 23, 2011 Share Posted April 23, 2011 Hey guys. My current goal is to make an entire interface for my role play script out of dxDraw functions (image, rectangle, etc.). Obviously, drawing the items is not a problem. What I want though are buttons, edit fields, scroll bars, grid lists and other stuff available with GUI made with dxDraw functions. My first idea for making buttons would be to draw an image, and then create a GUI button underneath and make it invisible. My button would then look like my custom image, and I could also use events from GUI. However I haven't thought of a way to efficiently create edit fields and other stuff. For the edit field, maybe put an invisible edit field underneath too? I dunno. My question is, what's the easiest way to create something like that? I need a system that allows me to quickly create buttons and edit fields, etc. and also to remove them. Cheers, NeXTreme Link to comment
Moderators Citizen Posted April 23, 2011 Moderators Share Posted April 23, 2011 Hi, I making a resource to convert every gui functions in directX functions. Exemple: -- FUNCTIONS: dxCreateStaticImage( x, y, sx, sy, path, relative, parent ) dxSetPosition( dxElement, x, y , relative) dxGetPosition( dxElement, relative ) dxSetSize( dxElement, sx, sy , relative) dxGetSize( dxElement, relative ) -- EVENTS: onClientDXClick I start to create this system last week. At this time, all functions and the event works ( and the parent/children system too ). I will upload my resource on the community when the basics gui functions are done for the 1st version then I will add other functions from the gui system. But the tabs and the scoll system will be very hard To change all your gui's in directX => replace all 'gui' by 'dx' Link to comment
NeXTreme Posted April 23, 2011 Author Share Posted April 23, 2011 I remember SoundWave mentioning something about that... Anyways, I hope you're done soon. I need this real bad so if you need help, I'd be happy to assist you. Link to comment
vEnom.sk Posted April 26, 2011 Share Posted April 26, 2011 I have started making a directx GUI few weeks ago. At the moment, windows, buttons, checkboxes and edit fields are done. Scrollbars are mostly finished. Windows are fully movable, customizable (colors) and will be resizable too. Buttons have different background image when being idle, hovered or clicked. Clicking every dx gui element triggers onCLientDXGUIClick event and much more. Now I see that were doing independently the same. I thought it is very unlikely to happen. *TIP After finishing scrollbars and scrollpanes, you can use them to make gridlist, so you don't have to double your work. But actually srollpanes seems very hard to make in a general way. Link to comment
Castillo Posted April 26, 2011 Share Posted April 26, 2011 vEnom, will you release this? as it looks pretty nice Link to comment
vEnom.sk Posted April 26, 2011 Share Posted April 26, 2011 When I will finish some neccessary things, yes. Link to comment
Kenix Posted April 26, 2011 Share Posted April 26, 2011 New dx gui in mta This is really Cool! Link to comment
Castillo Posted April 26, 2011 Share Posted April 26, 2011 When I will finish some neccessary things, yes. Well, i will be waiting, i would like to create different GUI styles than the normal one Link to comment
Moderators Citizen Posted April 27, 2011 Moderators Share Posted April 27, 2011 Nice vEnom This is the list of functions/events that I have scripted (since last week ): element dxCreateStaticImage ( float x, float y, float width, float height, string path, bool relative, [element parent = nil] )bool dxSetPosition ( element dxElement, float x, float y, bool relative )float, float dxGetPosition ( element dxElement, bool relative )bool dxSetSize ( element dxElement, float width, float height, bool relative )float, float dxGetSize ( element dxElement, bool relative )bool dxStaticImageLoadImage ( element dxElement, string filename )string dxGetStaticImage( element dxElement ) -- return the filepath bool dxGetVisible ( element dxElement )bool dxSetVisible ( element dxElement, bool state )bool dxSetAlpha ( element dxelement, float alpha )int dxGetAlpha ( element dxElement )onClientDXClick => Parameters: string button, string state, int absoluteX, int absoluteYonClientDXDoubleClick => Parameters: string button, string state, int absoluteX, int absoluteY ( only "up" is send for the state ) The parent and the relative system works. Now I will make the window, button, edit, checkboxes etc with the CGUI.png (all images used by the gui system is in this pictures ) The goal: to make the same system than the gui with the same design, functions and events => just replace 'gui' by 'dx' and 'GUI' by 'DX' and it will works ! Link to comment
Castillo Posted April 27, 2011 Share Posted April 27, 2011 Citizen, i'm suposing it will have a difference, right? because we don't need a DX gui just exactly like the normal GUI. Link to comment
Moderators Citizen Posted April 28, 2011 Moderators Share Posted April 28, 2011 I will make a system that the player can choose an interface and all peoples can make his own CDX.png ( it's the name of CGUI.png in my resource ) Yes ! Every DD/Race server want it because when you use the GUI system and you spectate another player, when this player starts the nos, the GUI disappears from the screen ! Do the test. So for the 1st release, it will make exactly the same than the GUI system but all servers can replace the CDX.png by his own CDX.png. Do you understand ? ( Sorry for my poor english ) Link to comment
BinSlayer1 Posted April 28, 2011 Share Posted April 28, 2011 Nice work guys still i wonder, what's actually the big deal with everyone trying to use dx functions over the mta gui? In what ways are the dx functions better? is it just for the looks, or is there actually any difference in performance? Link to comment
proracer Posted April 28, 2011 Share Posted April 28, 2011 They can be used dynamically, like example for small real time clock, gui can't do that - gui is static. Link to comment
Moderators Citizen Posted April 28, 2011 Moderators Share Posted April 28, 2011 They can be used dynamically, like example for small real time clock, gui can't do that - gui is static. yeah but you can use guiStaticImageLoadImage or guiSetPosition or guiSetSize etc, so it's not really 'static' like you said. In what ways are the dx functions better? For me, it's just the problem of the nos with the GUI system that the dx system doesn't have Link to comment
eAi Posted April 29, 2011 Share Posted April 29, 2011 You know, you could probably add custom GUI skin support to MTA with a day or two's work, which would be much easier for everyone than reimplementing the GUI from scratch. 1.1 supports skin switching, so it's not much of a step from there. Link to comment
NeXTreme Posted April 29, 2011 Author Share Posted April 29, 2011 The skin idea is nice, then however everyone would have different look, which is not my point. Maybe a new client function to set the skin to a player? guiSetSkin(string imagePath) This one looks cool: Anyways, I want to use dxDraw because I can make it look much better than GUI, allows me to draw images and text, and with a little work you can create nice animations for opening/closing interfaces, changing windows, etc.. The problem of course is making it "interactive". Every DD/Race server want it because when you use the GUI system and you spectate another player, when this player starts the nos, the GUI disappears from the screen I have never encountered this problem, I used a combination of GUI and dxDraw for a race userpanel and I never saw that. Link to comment
Moderators Citizen Posted April 29, 2011 Moderators Share Posted April 29, 2011 You know, you could probably add custom GUI skin support to MTA with a day or two's work, which would be much easier for everyone than reimplementing the GUI from scratch.1.1 supports skin switching, so it's not much of a step from there. Yeah maybe but I want to remake the GUI system in directX. Why ? Answer: because when you use the GUI system and you spectate another player, when this player starts the nos, the GUI disappears from the screen ! @NeXTreme: Awesome skin 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