Hosted by sourceforge.net
Valid XHTML 1.0 Transitional


 

Developers Corner


Welcome Developer! On this page you can find some information, useful if you like to develop for Trophy or if you're working on other projects which are based on ClanLib.


Subversion Repository | Gimp Scripts | ClanLib Extensions


Subversion Repository

If You're A Linux User

There's a SVN repository available for Trophy at the Sourceforge server. To checkout anonymously and build the most recent version, please launch the following commands in a shell:

svn co http://trophy.svn.sourceforge.net/svnroot/trophy trophy
cd trophy
./configure
make

If you're a developper, you can also checkout using your username :

svn co https://trophy.svn.sourceforge.net/svnroot/trophy trophy
cd trophy
./configure
make


Gimp Scripts


The following Gimp Scripts can help you to render sprites for any ClanLib project or even other projects.

To use these scripts, you must copy them to the directory "~/.gimp/scripts/". Afterwards, please start the Gimp or choose "Xtns" -> "Script-Fu" -> "Refresh" if the Gimp already runs. Now you can find the Scripts in "Xtns" -> "Script Fu" -> "My".

Rotate Sprite Into The Same Image (ClanLib Animation)

Download:

render-sprite-clan.scm

Description:

Click here for a brief description of this script.

Rotate Sprite Into Separate Images

Download:

render-sprite.scm

Description:

Click here for a brief description of this script.



ClanLib Extensions


The class CAImageManipulation might be interesting for other ClanLib programmers. That's why I briefly describe it here. For a more detailed documentation, please take a look at the source. Or view the source documentation online.

Download

You can download the class source from here (release 20000602a). You need no other Trophy classes to make use of it.


Rotating Surfaces

static CL_Surface*

rotate(

CL_Surface* surface,
float angle,
bool exact );

This method creates a new surface based on the given one with a rotated angle. The original surface gets not changed. The size (width/height) of the new surface is equal to the size of the original surface.
If 'exact' is true, the result is smoother. If 'exact' is false, the method is much faster but the result might be not as good.


Example:

Original

Rotated
'exact'=true

Rotated
'exact'=false

Rotate example : original

Rotate example : rotated with exact flag at true

Rotate example : rotated with exact flag at false


Flipping Surfaces

static CL_Surface*

flip(

CL_Surface* surface,
bool horizontal );

This method creates a new surface which is a flipped copy of the original one. The original surface gets not changed.
If 'horizonal' is true, the surface gets flipped horizontal (left to right and vice versa). Otherwise, the surface gets flipped vertical (upside down)


Changing HSV Of Surfaces

static CL_Surface*

changeHSV(

CL_Surface* surface,
int hue,
int saturation,
int value );

With this method, you can change the hue (H), saturation (S) and the value (V) of the image.

Changing the 'hue' means to rotate the color in the rainbow color spectrum. This is often used for color-cycling effects or to change the color of objects. In the example below, the car is saved on disk in red. With this method, all cars in other colors can be generated from this image at runtime. The valid range for this parameter is 0...360.

The 'saturation' is the color strength of the image. A very low value results in a gray-scale image. The valid range is -100...100

The 'value' gives the lightness of the image. A high value results in a bright image while a low value results in a darker image. The valid range is -100...100.

Example:

Original

Hue 60

Hue 120

Hue 180

Hue 240

Hue 300

Hue modification : Original

Hue modification : Hue 60

Hue modification : Hue 120

Hue modification : Hue 180

Hue modification : Hue 240

Hue modification : Hue 300

Sat. -100

Sat. -66

Sat. -33

Sat. 33

Sat. 66

Sat. 100

Saturation modification : -100

Saturation modification : -66

Saturation modification : -33

Saturation modification : 33

Saturation modification : 66

Saturation modification : 100

Val. -100

Val. -66

Val. -33

Val. 33

Val. 66

Val. 100

Value modification : -100

Value modification : -66

Value modification : -33

Value modification : 33

Value modification : 66

Value modification : 100