Page 1 of 1

How do I add custom graphics to CEs?

Posted: Tue Sep 04, 2018 2:25 am
by ncrecc
There must be some documentation to this that I can't find. All I know is that it involves some .pcx extension.

Re: How do I add custom graphics to CEs?

Posted: Tue Sep 04, 2018 9:01 am
by Eizzoux
1. First you need to create new folder "graphics" in the level set you want to add new graphics to. Then open Notepad and click "File>Save as", change file type from "Text file (.TXT)" to "Any file", save the file to that new "graphics" folder as "graphicsinfo.conf" (yes, .CONF, not .TXT).
'graphicsinfo.conf' & 'player.png'
'graphicsinfo.conf' & 'player.png'
bn0.jpg (26.33 KiB) Viewed 7604 times
Then you need to have at least one file with width and height that can be divided by 32 (for example, 256x128, 160x64 or 640x354) and any supportable image file (for example PCX or PNG). I'll have the PNG image 192x64 as example. Each frame in it must be aligned on 32x32 pix. grid.
Here's the "player.png" image example
Here's the "player.png" image example
bn1.jpg (67.34 KiB) Viewed 7604 times
Open the "graphicsinfo.conf" file you created if you closed Notepad after creating it. Type this in there:

Code: Select all

custom_1: [name of image file you need]
custom_1.xpos: [X-position of the needed frame counting from 0]
custom_1.ypos: [Y-position of the needed frame counting from 0]
custom_1.frames: [the frames count for animation]
custom_1.delay: [delay between frames (1=0.02 second=20 milliseconds, not neccessary if frames count is '1')]
custom_1.anim_mode: [animation mode: none, loop, pingpong, pingpong2, linear, random, reverse (can be combined with other anim modes), and some other "special" ones, not neccessary if you just want it to be normally looping]
Here're these "animation modes" shown as the frames order:
Animation types
Animation types
bn4.jpg (289.43 KiB) Viewed 7604 times
Here're two examples:
File setting and sprite position
File setting and sprite position
bn2.jpg (78.88 KiB) Viewed 7604 times
Animating
Animating
bn3.jpg (93.18 KiB) Viewed 7604 times
You can also do different animations for moving, pushing, collecting, exploding, turning, falling or just standing still for different directions, you just need to add few new rows with the needed element, needed action and direction ([element].[action].[direction]).
'[element].[action].[direction]'
'[element].[action].[direction]'
bn5.png (54.16 KiB) Viewed 7604 times
For example:

Code: Select all

custom_1.left:player.png
custom_1.left.xpos:4
custom_1.left.ypos:0
custom_1.left.frames:1
custom_1.right:player.png
custom_1.right.xpos:1
custom_1.right.ypos:1
custom_1.right.frames:1
custom_1.down:player.png
custom_1.down.xpos:1
custom_1.down.ypos:0
custom_1.down.frames:1
custom_1.up:player.png
custom_1.up.xpos:4
custom_1.up.ypos:1
custom_1.up.frames:1
custom_1.moving.left:player.png
custom_1.moving.left.xpos:3
custom_1.moving.left.ypos:0
custom_1.moving.left.frames:3
custom_1.moving.left.delay:4
custom_1.moving.left.anim_mode:pingpong
custom_1.moving.right:player.png
custom_1.moving.right.xpos:0
custom_1.moving.right.ypos:1
custom_1.moving.right.frames:3
custom_1.moving.right.delay:4
custom_1.moving.right.anim_mode:pingpong,reverse
custom_1.moving.down:player.png
custom_1.moving.down.xpos:0
custom_1.moving.down.ypos:0
custom_1.moving.down.frames:3
custom_1.moving.down.delay:4
custom_1.moving.down.anim_mode:pingpong
custom_1.moving.up:player.png
custom_1.moving.up.xpos:3
custom_1.moving.up.ypos:1
custom_1.moving.up.frames:3
custom_1.moving.up.delay:4
custom_1.moving.up.anim_mode:pingpong,reverse

Re: How do I add custom graphics to CEs?

Posted: Tue Sep 04, 2018 4:30 pm
by ncrecc
That explains everything, thank you!

Re: How do I add custom graphics to CEs?

Posted: Wed Sep 05, 2018 10:43 am
by Holger
Thanks a lot, Eizzoux, for this comprehensive and very detailed explanation of how to define custom graphics for custom elements in R'n'D! You did it *much* better than I could have done it myself, and added great illustrations to show how it works!

This post should be part of a larger "custom artwork" documentation yet to be written, but it's really the basics most people will probably want to start with!

Thanks again! :)