This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:orx:tutorials:community:acksys:scrolled0 [2012/08/12 19:11 (12 years ago)] – acksys | en:tutorials:orxscroll:maps-in-scrolled [2020/08/31 08:51 (4 years ago)] (current) – ↷ Links adapted because of a move operation iarwain | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ScrollEd is a map editor that can be used with Scroll. | + | ===== Creating Maps in ScrollEd ===== |
+ | |||
+ | ScrollEd is a map/ | ||
+ | |||
+ | ==== Compiling ScrollEd with Scroll ==== | ||
+ | |||
+ | ScrollEd is included in the Scroll header files, so you don't have to make any changes to your Scroll project to use it. However, you do have to make sure it is being compiled. | ||
If you have the following defined in a source or header file, comment or remove it. Otherwise, ScrollEd will not be compiled when Scroll is compiled. | If you have the following defined in a source or header file, comment or remove it. Otherwise, ScrollEd will not be compiled when Scroll is compiled. | ||
+ | <code c> | ||
#define __NO_SCROLLED__ | #define __NO_SCROLLED__ | ||
+ | </ | ||
+ | |||
+ | ==== Running ScrollEd ==== | ||
+ | |||
+ | Running your game's executable will start the game by default. If you want to start ScrollEd, you need to run the executable with the < | ||
+ | |||
+ | You must also specify a map file to edit using the < | ||
+ | |||
+ | If you don't want to specify a map file on the command line every time, you can specify a default map file in Orx config as follows: | ||
+ | |||
+ | < | ||
+ | [Param] | ||
+ | map = ../ | ||
+ | </ | ||
+ | |||
+ | Orx objects to be used in ScrollEd need a new config property. The " | ||
+ | |||
+ | < | ||
+ | [O-Boy] | ||
+ | Graphic = G-Boy | ||
+ | ScrollEdSet = Players | ||
+ | |||
+ | [O-EnemyBug] | ||
+ | Graphic = G-EnemyBug | ||
+ | ScrollEdSet = Enemies | ||
+ | </ | ||
+ | |||
+ | After you've defined the ScrollEdSet for each of your Orx objects in config, run ScrollEd again. You will be able to use the mouse wheel to scroll through the object sets. The previous config would create two sets, Players and Enemies, and allow you to switch between them. | ||
+ | |||
+ | The following keyboard and mouse commands are available in ScrollEd. You can find them in data/ | ||
+ | |||
+ | < | ||
+ | [Input] | ||
+ | SetList = ScrollEdInput # ScrollInput | ||
+ | |||
+ | [ScrollEdInput] | ||
+ | MOUSE_LEFT | ||
+ | MOUSE_RIGHT | ||
+ | MOUSE_MIDDLE | ||
+ | |||
+ | MOUSE_WHEEL_UP | ||
+ | MOUSE_WHEEL_DOWN | ||
+ | |||
+ | KEY_SPACE | ||
+ | |||
+ | KEY_LALT | ||
+ | KEY_RALT | ||
+ | |||
+ | KEY_F12 | ||
+ | |||
+ | KEY_LCTRL | ||
+ | |||
+ | KEY_DELETE | ||
+ | KEY_BACKSPACE | ||
+ | |||
+ | KEY_F6 | ||
+ | KEY_F9 | ||
+ | |||
+ | KEY_Z = ToggleMove | ||
+ | KEY_X = ToggleScale | ||
+ | KEY_C = ToggleRotate | ||
+ | KEY_S = ToggleSnap | ||
+ | |||
+ | KEY_G = ToggleGrid | ||
+ | |||
+ | KEY_D = ToggleDifferential | ||
+ | |||
+ | KEY_A = Antialiasing | ||
+ | KEY_T = Tiling | ||
+ | |||
+ | KEY_R = EditAlpha | ||
+ | KEY_Q = EditRed | ||
+ | KEY_W = EditGreen | ||
+ | KEY_E = EditBlue | ||
+ | |||
+ | KEY_TAB | ||
+ | |||
+ | KEY_F3 | ||
+ | KEY_HOME | ||
+ | |||
+ | KEY_ESCAPE | ||
+ | |||
+ | KEY_F5 | ||
+ | |||
+ | CombineList | ||
+ | </ | ||
+ | |||
+ | Place your objects as you like them and then press F6 to save your map! | ||
+ | ===== Loading ScrollEd maps in Scroll ===== | ||
+ | |||
+ | When you want to load a new map, you need to tell Scroll to load the new map. You probably also want to pause the game while this is happening. Your game's Update function might be a good place to check and implement this. | ||
+ | |||
+ | Use the following routine to accomplish the map load: | ||
- | Command line switch -editor | + | <code c> |
- | command line switch -map | + | // Sets map name |
+ | SetMapName(" | ||
- | data/ScrollEd.ini for commands. | + | // Pauses game |
+ | PauseGame(orxTRUE); | ||
- | map must be either specified on the command line with -map switch | + | // Stops game |
+ | StopGame(); | ||
- | Orx objects to be used in ScrollEd need a new property not supported in Orx | + | // Loads map |
+ | LoadMap(); | ||
- | ScrollEdSet | + | // Unpauses game |
+ | PauseGame(orxFALSE); | ||
- | Used to define " | + | // Starts game |
+ | StartGame(); | ||
+ | </ | ||
+ | |||
+ | SetMapName, StopGame, LoadMap, PauseGame, and StartGame are all defined | ||
+ | Scroll also includes an OnMapLoad virtual function callback. You can override this if you want to wait until the map is loaded to execute code. | ||