|
Squat
|
 |
« Reply #3 on: February 07, 2009, 02:45:27 PM » |
|
Dudes, all you gotta do is open the menu editor and play with it. There's no need to hand code anymore, trust in good old trustworthy Squat on this one. Ok, you do still write code by hand, but you can do it in the editor, just add the advanced parameters like OnPress and doing, script window! Looks like it don't take inputs, but it does.
The only thing I can't figure out yet is how to load in an icon image onto a form and put it exactly where I want it to be through script. Well, I'm lying I can do that, but I can't get it to move to another spot yet based on the code. I can hide and unhide them but if I wanted a rolling inventory with them moving all over, I'd be lost right now.
I'm used to coding 2D interfaces, generally speaking it's a lot like Flash. But we don't have a direct timeline and I think there's a leap of faith in dictating which "sprite" you're trying to access. I can't see how to figure it out quite yet, but I'm still stuck on something else.
Just don't forget the most powerful tool in the menu editor, and that's "CLONE".
BTW, i put up a completely custom menu interface example eons ago featuring a script for customizing a giant M16 that's in the world. That wasn't a demo kids, them's was the real files and all the .psd's to boot. Should I bother providing people with examples anymore? Are people even looking at them? Did you learn anything? I have yet to field question one.
In the end, it's "about" as easy as creating it yourself in Photoshop. However, if you want to have nice rollovers and really good stuff, you have to do things somewhat the right way. While you CAN crop an image in PS, you get all the other crap too, so a button would now be locked into position. Considering PS's natural capture of the alpha channel, why not just export the buttons as smaller, separate images with their own transparency and move them about in the menu editor using the position sliders? Now you can put that button anywhere and even give it a shadow. If you build in Photoshop with planning and intelligence for all the elements you need and spend due care to export them each properly (at their right sizes), you should have a pretty easy time controlling it in the editor. Every button in the samples has script on it that you can look at...most just hide and show forms and load and unload worlds, but you have COMPLETE script access at that level to the whole rest of the game, so do whatever you need in your menus. Look at Gary's Mod for the kinds of things you could think up to control in a menu.
Lastly, there's no coding involved in moving things, resizing them or cropping them. There are sliders in the menu editor for all of that. You in no way have to match .psd sizes. Though you certainly could. The hardest thing to realize at first is that each element sits within its parent element and is in position in relation to that parent. So a picture box that's on the right, inside a menu form that's on the left will be in the middle of the screen. If you're having trouble moving something that you want to, you may need to adjust the size or position of its parent item in the list of elements you get for each menu. You can clearly see the heirarchy sub-tree and you can also drag it around to alter it.
|