FreeCraft Configuration Language Description: Icon
___________ _________ _____ __
\_ _____/______ ____ ____ \_ ___ \____________ _/ ____\/ |_
| __) \_ __ \_/ __ \_/ __ \/ \ \/\_ __ \__ \\ __\\ __|
| \ | | \/\ ___/\ ___/\ \____| | \// __ \| | | |
\___ / |__| \___ >\___ >\______ /|__| (____ /__| |__|
\/ \/ \/ \/ \/
______________________ ______________________
T H E W A R B E G I N S
FreeCraft - A free fantasy real time strategy game engine
(C) Copyright 2002-2003 by The FreeCraft Project. Distributed under the
"GNU General Public License"
FreeCraft
Readme
FAQ
CCL
PREV
NEXT
Index
define-icon
define-icon-alias
define-icon-wc-names
set-icon-size!
set-icons-per-row!
Intro - Introduction to icon functions and variables
Everything around the C icon structure.
Functions
define-icon
Description
Define an icon for the engine.
This could also be defined in own levels.
Syntax
(define-icon ident 'tileset tileset 'size '(x y) type '(index file))
- ident
- The name of the icon.
- 'tileset tileset
- Optional name of the tileset.
- 'size '(x y)
- Size of the icon in pixel.
- x
- Width in pixel.
- y
- Height in pixel.
- type
-
- 'normal is a normal icon, its look is defined with (index file).
- index
- The index into the graphic file.
- file
- The filename of the graphic file containing the graphics.
Example
(define summer-icons-file "tilesets/summer/icons.png")
(define-icon 'icon-peasant 'tileset 'tileset-summer 'size '(46 38) 'normal
'(0 summer-icons-file))
Define the peasant icon referenced with icon-peasant for the summer tileset.
It is a normal static icon with a sizeof 46x38 pixel. The graphic is loaded
from summer-icons-file, which is defined to be the file
"tilesets/summer/icons.png" and is the first icon in this file.
define-icon-alias
Description
Define an icon alias for an icon.
This is an alternative name for the icon.
Syntax
(define-icon-alias alias icon)
- alias
- The new alias name.
- icon
- An already existing icon name.
Example
(define-icon-alias 'icon-raise-dead 'icon-skeleton)
Now it is possible to get the icon "skeleton" also with the name
"icon-raise-dead".
define-icon-wc-names
Description
Define the mapping of the icon numbers in puds, to the icon names.
Syntax
(define-icon-wc-names icon-0 icon-1 ... icon-195)
- icon-0
- Name of the icon assigned to index 0 (peasant).
- icon-1
- Name of the icon assigned to index 1 (peon).
- icon-195
- Name of the icon assigned to index 195. In the original only until this
number are icons defined.
Example
(define-icon-wc-names
'icon-peasant 'icon-peon 'icon-footman ... )
This is the default icon mapping.
Used
$LIBARYPATH/ccl/wc2.ccl
set-icon-size!
Description
.
Syntax
(set-icon-size! width height)
- width
- Width of the icons.
- height
- Height of the icons.
Example
(set-icon-size! 46 38)
Sets the icon size to 46x38.
Used
$LIBARYPATH/ccl/icons.ccl
set-icons-per-row!
Description
.
Syntax
(set-icons-per-row! icons)
- icons
- Number of icons per row.
Example
(set-icons-per-row! 5)
Sets the number of icons per row to 5.
Used
$LIBARYPATH/ccl/icons.ccl
Last changed: $Id: icon.html,v 1.11 2003/02/05 00:35:02 jsalmon3 Exp $
All trademarks and copyrights on this page are owned by their respective owners.
(c) 2002-2003 by
The FreeCraft Project