CRE8OR - game maker for anim8or |
||
|
BILLBOARDS/SPRITES
Cre8or v0.12b has a new feature that allows you to have 2D pictures in the games. However you have to use scripts to add billboards. To add a sprite/billboard first we need to create a set of billboards: The following code is in a code piece in the Scene Create Event: To add a billboard set you create a new class: ten <- billboards() Now we need to initiate it. ten.create(10, "10points.png", 15.0, 15.0) The first parameter "10" is the number of billboards you plan on creating. The Next one is the texture file name you want to load it. You can add a texture to the game and use the file name for that. The next to numbers "15.0" is the height and width of the image in 3D. Make sure you width and height values have the decimal place. Now we should set the type of billboards to use: ten.set_type(BBT_POINT) usre respectively: BBT_POINT Here's a discription of the different types: point -
The default arrangement, this approximates spherical particles and the billboards always fully face the camera. To set a direction if you use the "Common" types then use this: ten.set_dir( vector(x, y, z) ) Make sure the values have the decimal place. To add a billboard use the following code: ten.add(vector(15.0, 0.0, 15.0), color(1.0, 1.0, 1.0)) The first parameter: vector(15.0, 0.0, 15.0) is the position. The second one is the color: color(1.0, 1.0, 1.0) To control the position of a single billboard use this: bb1 <- ten.add(vector(15.0, 0.0, 15.0), color(1.0, 1.0, 1.0)) bb1.set_position( vector(15.0, 0.0, 15.0) ) bb1.set_orientation( quaternion ) bb1.set_color( color(1.0, 1.0, 1.0) ) bb1.set_dimensions( width, height) To remove it do this: bb1.remove() To remove all the billboards do this: ten.clear()
|
|
Copyrights (C) 2007 Keith Tabert |
||