User Tools

Site Tools


en:tutorials:orxscroll:maps-in-scrolled

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:tutorials:orxscroll:maps-in-scrolled [2012/08/12 19:11 (9 years ago)]
acksys
en:tutorials:orxscroll:maps-in-scrolled [2020/08/31 08:51 (15 months ago)] (current)
iarwain ↷ Links adapted because of a move operation
Line 1: Line 1:
-ScrollEd is a map editor that can be used with Scroll.+===== Creating Maps in ScrollEd ===== 
 + 
 +ScrollEd is a map/​level ​editor that can be used with [[en:​tutorials:​orxscroll:​introduction-orxscroll|Scroll]]. 
 + 
 +==== 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__
 +</​code>​
 +
 +==== 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 <​code>​-editor</​code>​ command line switch.
 +
 +You must also specify a map file to edit using the <​code>​--map</​code>​ switch.
 +
 +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:
 +
 +<​code>​
 +[Param]
 +map = ../​data/​map/​Level1.map;​ <= Setting a default map if none is specified on the command line
 +</​code>​
 +
 +Orx objects to be used in ScrollEd need a new config property. The "​ScrollEdSet"​ property is used to define "​object sets" used in ScrollEd.
 +
 +<​code>​
 +[O-Boy]
 +Graphic = G-Boy
 +ScrollEdSet = Players
 +
 +[O-EnemyBug]
 +Graphic = G-EnemyBug
 +ScrollEdSet = Enemies
 +</​code>​
 +
 +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/​ScrollEd.ini
 +
 +<​code>​
 +[Input]
 +SetList = ScrollEdInput # ScrollInput
 +
 +[ScrollEdInput]
 +MOUSE_LEFT ​       = Action
 +MOUSE_RIGHT ​      = Pan # Zoom
 +MOUSE_MIDDLE ​     = Copy # HideSet
 +
 +MOUSE_WHEEL_UP ​   = NextSet # NextLayer
 +MOUSE_WHEEL_DOWN ​ = PreviousSet # PreviousLayer
 +
 +KEY_SPACE ​        = ClearSelection # HideSet
 +
 +KEY_LALT ​         = SoftClearSelection
 +KEY_RALT ​         = SoftClearSelection
 +
 +KEY_F12 ​          = Screenshot
 +
 +KEY_LCTRL ​        = Zoom # PreviousLayer # NextLayer
 +
 +KEY_DELETE ​       = Delete
 +KEY_BACKSPACE ​    = Delete
 +
 +KEY_F6 ​           = Save
 +KEY_F9 ​           = Reload
 +
 +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 ​          = ResetZoom
 +
 +KEY_F3 ​           = ToggleFullScreen
 +KEY_HOME ​         = ReloadHistory
 +
 +KEY_ESCAPE ​       = Quit
 +
 +KEY_F5 ​           = StartGame
 +
 +CombineList ​      = @ScrollEdInput.KEY_LCTR
 +</​code>​
 +
 +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("​MyMap.map"​);​
  
-data/ScrollEd.ini for commands.+// Pauses game 
 +PauseGame(orxTRUE);​
  
-map must be either specified on the command line with -map switch ​(doesn'​t work ?or in config [Param] map = +// 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 "​object sets" used in ScrollEd+// Starts game 
 +StartGame();​ 
 +</​code>​ 
 +   
 +SetMapName, StopGame, LoadMap, PauseGame, and StartGame are all defined ​in the Scroll classes.
  
 +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.
  
en/tutorials/orxscroll/maps-in-scrolled.1344823896.txt.gz · Last modified: 2017/05/30 00:50 (5 years ago) (external edit)