Anonymous user
AGS Editor & User Interface: Difference between revisions
→Editing Displaying close-ups of inventory: updated for AGS 2.7
No edit summary |
*>SSH (→Editing Displaying close-ups of inventory: updated for AGS 2.7) |
||
Line 6: | Line 6: | ||
With a separate room, you will have to make sure that once you are done with the close-up room, you have code in the first room that, once you return to it, it will place you at the same place you were when you looked at the item. You might have to use global variables for this (check the manual regarding them). So basically, in the "'''Look at inventory'''" interaction script, write the command to change the current room to whatever room number you choose as the close-up room. Then, in the "'''Player enters room (after fade-in)'''" script, write the script to display a description of the item, then wait a little bit perhaps, then change rooms to the player's previous room ('''character[ABC].prevroom''' or '''cAbc.PreviousRoom''' for AGS V2.7 and newer). | With a separate room, you will have to make sure that once you are done with the close-up room, you have code in the first room that, once you return to it, it will place you at the same place you were when you looked at the item. You might have to use global variables for this (check the manual regarding them). So basically, in the "'''Look at inventory'''" interaction script, write the command to change the current room to whatever room number you choose as the close-up room. Then, in the "'''Player enters room (after fade-in)'''" script, write the script to display a description of the item, then wait a little bit perhaps, then change rooms to the player's previous room ('''character[ABC].prevroom''' or '''cAbc.PreviousRoom''' for AGS V2.7 and newer). | ||
When using a GUI for the close-up, it's rather simpler than using a separate room, and you can even have the close-up cover only a large portion of the room, and not replace it entirely. So, create a new GUI and put in a button that you will use as (1) an image to display the close-up, and (2) a method of getting rid of the GUI to go back to the room (by clicking on it). After you create the GUI and set the colors and settings you want, create a button and resize it to your liking. Set the image to the close-up sprite (after you import the image, of course), and set the button's property to "'''Run script'''". In your global script, you should see an interface_click function. Inside, there are a collection of if/else if commands. These check to see what GUI (interface) was active and what object (generically called button) was clicked on it. Let's say that you created GUI #6. In the code, add an else if command to check if interface passed 6 as a value. If you are only having an image/button in your GUI, you do not need any other if code to determine which button was clicked, because there is only one possibilty for that GUI. Then, insert the code that will close down the GUI. To activate the GUI, put the code in the "'''Look at inventory'''" interaction event, just like above. | When using a GUI for the close-up, it's rather simpler than using a separate room, and you can even have the close-up cover only a large portion of the room, and not replace it entirely. So, create a new GUI and put in a button that you will use as (1) an image to display the close-up, and (2) a method of getting rid of the GUI to go back to the room (by clicking on it). After you create the GUI and set the colors and settings you want, create a button and resize it to your liking. Set the image to the close-up sprite (after you import the image, of course), and set the button's property to "'''Run script'''". | ||
If you are using AGS 2.7 or later, you should then give the button an object name. Once you have done this you can double-click the button in the editor to access the button's script function. The code to close down the GUI would be something like: | |||
function btnCloseUp_Click(GUIControl *control, MouseButton button) { | |||
control.OwningGUI.Visible=false; | |||
} | |||
For AGS 2.62 or earlier: In your global script, you should see an interface_click function. Inside, there are a collection of if/else if commands. These check to see what GUI (interface) was active and what object (generically called button) was clicked on it. Let's say that you created GUI #6. In the code, add an else if command to check if interface passed 6 as a value. If you are only having an image/button in your GUI, you do not need any other if code to determine which button was clicked, because there is only one possibilty for that GUI. Then, insert the code that will close down the GUI. To activate the GUI, put the code in the "'''Look at inventory'''" interaction event, just like above. | |||
==Simulating 3D distance perspective with scalable walkable areas== | ==Simulating 3D distance perspective with scalable walkable areas== |