SMC:Sprites

From Secret Maryo Chronicles Wiki
Jump to: navigation, search

The sprites in this game have an interesting design: They scale the graphics automatically to the active resolution but the internal resolution is always 800x600. These sprites are used all over the place and use .settings files to describe their properties.

Contents

Location

You'll find the sprites in the relative path ./data/pixmaps/.

Use

You can contribute vector graphics for this game! Please first take a look into our Todo Graphics to see which graphics are needed and in what style or ask in the Forums. The Editor always scans for usable image settings and shows the valid ones.

Size

The Engine can only handle images with a power of 2 pixel width and height which are 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048 and 4096 but note that some resolutions like 2048 and higher are not supported by old or cheap video cards, that means SMC has to resize them to the highest supported resolution for this card. The width and height can be different in size. The image resolution should be around 4 times the size of the dimension it should appear in game (the width and height in the .settings file), to be available unscaled at high resolutions like 2048x1536 with the best image quality.

Level interior

One sprite has the ability to be in one of the following massive modes:

Mode Description
Massive You can't pass through this object
Halfmassive You can jump through this object onto the top of it; you can press down to fall through the floor
Passive Object is shown in the background but doesn't affect you
Front passive Object is shown in the foreground (over Maryo and Enemies) but doesn't affect you
Climbable If pressing up, you can climb this object

Image Settings Definition

When you add a new sprite, you have to add a settings file, describing information on the image. If your image is named

image_left.png

then you add a file called

image_left.settings

In this file you can add the following (explanatory) parameters:

  • base [filename] [use_settings]
    • filename: path to the source image or image settings.
    • use_settings: keeps the settings of the source image settings but get replaced if also defined in this file.
  • width [dimension]
    • dimension: pixel size for the ingame width. ( internal screen width is always 800 )
  • height [dimension]
    • dimension: pixel size for the ingame height. ( internal screen height is always 600 )
  • rotation [X] [Y] [Z]
    • X: rotates the image around the X axis 0-360°. ( 180° mirrors about the horizontal axis - any other value is not supported )
    • Y: rotates the image around the Y axis 0-360°. ( 180° mirrors about the vertical axis - any other value is not supported )
    • Z: rotates the image around the Z axis 0-360°. ( Rotates the image clockwise around its centre - only 90°, 180° and 270° are supported )
  • col_rect [X] [Y] [W] [H]
    • X: X minimum position - Amount of pixels from the left to start collision detection on.
    • Y: Y minimum position - Amount of pixels from the top to start collision detection on.
      • In the coordinate system used in this game, the positive Y direction is always pointing downwards.
    • W: Width - Width of the collision rectangle, in pixels.
    • H: Height - Height of the collision rectangle, in pixels.
  • mipmap [value]
    • value: If set to 1 this image is mipmapped and is drawn sharp if scaled down. Needed for images who can be scaled down by more than 50 % of their size to keep them good looking f.e. needed for Particles.
  • editor_tags [string]
    • string: Editor tags separated by ';' currently used to put the image into the matching Editor menus.
    • This tag must be present and set to either level or world for the object to appear in the editor. There should also be another tag to define what editor group it goes in. Please look at other settings files for examples of groups.
  • name [string]
    • string: Editor/Global image name.
  • type [value]
    • value: Default Editor/Global massive type. Can be massive, passive, front_passive, halfmassive or climbable.
  • ground_type [value]
    • value: The ground type alters the walking stability on it and the particles it creates. Can be normal, earth, ice, sand, stone or plastic.
  • obsolete [value]
    • value: If set to 1 this image is displayed in a transparent red in the editor to show it's now obsolete.


It is possible to use only one image but change it by rotation, scale, and more in several ways you want to use it, f.e. see the pipes. Your directory content could look like this for a image rotated in all direction:

image_left.png
image_left.settings
image_right.settings
image_up.settings
image_down.settings

Important is the col_rect parameter to remove the gaps on collision testing for example the Mushroom uses :

width 35
height 35
col_rect 6 4 23 31

The Mushroom image is 256x256 and gets scaled to 35x35 the col_rect does then set the real collision rectangle used ingame. You can view col_rects for every object in game by pressing CTRL+D.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox