From 0ed29302e6c3898187d57e512d5317a806409975 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ond=C5=99ej=20Ho=C5=A1ek?= Date: Tue, 10 May 2005 18:48:27 +0000 Subject: [PATCH] * Updated the scripting reference document.* Removed a duplicate of "white" in set_font SVN-Revision: 2464 --- docs/scripting/scripting.xml | 95 +++++++++++++++++++++++++++++++++++++------- src/object/text_object.cpp | 2 - 2 files changed, 81 insertions(+), 16 deletions(-) diff --git a/docs/scripting/scripting.xml b/docs/scripting/scripting.xml index e873dca32..69b8043ae 100644 --- a/docs/scripting/scripting.xml +++ b/docs/scripting/scripting.xml @@ -144,51 +144,118 @@ WOOT.set_animation("left"); - - set_animation - +Usage: <scriptedobject>.set_animation(string animation_name) +Effect: Activates the sprite's animation specified in animation_name. + get_animation - +Usage: <scriptedobject>.get_animation() +Returns: string +Effect: Returns the name of the sprite's current animation. + move - +Usage: <scriptedobject>.move(float x, float y) +Effect: Moves the object by x units to the right and y down relative to its current position. + set_pos - +Usage: <scriptedobject>.set_pos(float x, float y) +Effect: Basically identical to move, except its relativity to the sector origin. + get_pos_x - +Usage: <scriptedobject>.get_pos_x() +Returns: float +Effect: Returns the X coordinate of the object's position. + get_pos_y - +Usage: <scriptedobject>.get_pos_y() +Returns: float +Effect: Totally identical to get_pos_x except for its obvious choice of the other (Y) axis. + set_velocity - +Usage: <scriptedobject>.set_velocity(float x, float y) +Effect: Makes the object move in a certain direction (with a certain speed) given by the x and y coordinates. + get_velocity_x - +Usage: <scriptedobject>.get_velocity_x() +Returns: float +Effect: Returns the object's velocity in the direction of the X coordinate. + get_velocity_y - +Usage: <scriptedobject>.get_velocity_y() +Returns: float +Effect: The difference between this function and get_velocity_x is just the same like between get_pos_y and get_pos_x: same thing, different coordinates. + set_visible - +Usage: <scriptedobject>.set_visible(bool visible) +Effect: Shows or hides the object according to the value of visible. + is_visible - +Usage: <scriptedobject>.is_visible() +Returns: bool +Effect: Returns true if the object is visible. (You've seen this coming, haven't you?) + get_name - +Usage: <scriptedobject>.get_name() +Returns: string +Effect: Simply gives you the name of the scripted object (as if you didn't have it already...) Sound +This class provides a very simple interface to the audio subsystem. + +play_music (NYI) +Usage: Sound.play_music(string ???) +Warning: This function has not yet been implemented. + + +play_sound +Usage: Sound.play_sound(string sound_name) +Effect: Plays the sound specified in sound_name (that is identical to the filename of the sound without the .wav extension). + + Text +This module provides access to methods reponsible for displaying text on-screen. + +set_text +Usage: Text.set_text(string text) +Effect: Sets the text string to be displayed to text. + + +set_font +Usage: Text.set_font(string font) +Effect: Sets the font of the text to be displayed to text. Currently valid values are gold, white, blue, gray, big and small. + + +fade_in +Usage: Text.fade_in(float time) +Effect: Fades in the specified text for the next time seconds. + + +fade_out +Usage: Text.fade_out(float time) +Effect: Just the opposite of fade_out. + + +set_visible +Usage: Text.set_visible(bool visible) +Effect: Shows or hides the text abruptly (drastic counterpart to fade_in and fade_out. + + diff --git a/src/object/text_object.cpp b/src/object/text_object.cpp index 0cf7f8a05..7ad34c474 100644 --- a/src/object/text_object.cpp +++ b/src/object/text_object.cpp @@ -25,8 +25,6 @@ TextObject::set_font(const std::string& name) font = blue_text; } else if(name == "gray") { font = gray_text; - } else if(name == "white") { - font = white_text; } else if(name == "big") { font = white_big_text; } else if(name == "small") { -- 2.11.0