Tween Module
Version 1.1
Created by Edmundo Ruiz (edmundo@edmundito.com)
Additional scripting by Tzach Shabtay
This module can be used to create programatic animations. It supports most of the ags systems. It allows these effects to be blocking, non blocking, or loop them, and it has acceleration/deceleration timing functions.
Note that the script syntax differs a bit between AGS 3.x and AGS 2.x, which will be noted in this documentation. You can also make the AGS 2.x syntax also available in AGS 3.x by commenting out line 102 in the module script header, in case that you are porting your game to AGS 3.x and have written functions using Tween.
License
This module is distributed with the very liberal MIT License.
That said, you are most welcome but not obliged to give us credit in your game as:
Special Thanks
Edmundo Ruiz
Tzach Shabtay
And in the AGS Games database:
netmonkey Tween Module
tzachs Tween Module
Enumerated types
TweenTiming
enum TweenTiming { eLinearTween, eEaseInTween, eEaseOutTween, eEaseInEaseOutTween };
Used to set the timing of the tween, whether it's just a linear interpolation, one that only accelerates when it starts, one that only decelerates when it ends, or both accelerates at start and decelerates at end.
TweenStyle
enum TweenStyle { eBlockTween, eNoBlockTween, eRepeatTween, eReverseRepeatTween, };
Used to set the style of the tween, whether is blocking, non-blocking, repeating, or repeating reverse (where at the end of the tween cycle and repeats, it reverses the direction of the tween).
Functions
SecondsToLoops
// AGS 3.x and 2.x SecondsToLoops(float seconds);
Converts and returns the number of seconds into game loops.
Example:
Wait(SecondsToLoops(5.0));
Will wait for 5 seconds.
StopAllTweens
// AGS 3.x Character.StopAllTweens() GUI.StopAllTweens() Object.StopAllTweens() Label.StopAllTweens() Button.StopAllTweens() TextBox.StopAllTweens() ListBox.StopAllTweens() Slider.StopAllTweens() InvWindow.StopAllTweens() // AGS 2.x TweenStopAllForCharacter(Character* character) TweenStopAllForGUI(GUI* gui) TweenStopAllForObject(Object* object) TweenStopAllForLabel(Label* label) TweenStopAllForButton(Button* button) TweenStopAllForTextBox(TextBox* textBox) TweenStopAllForListBox(ListBox* listBox) TweenStopAllForSlider(Slider* slider) TweenStopAllForInvWindow(InvWindow* invWindow)
Stops all the Tweens currently playing on the a character, GUI, room object, etc.
Example:
// AGS 3.x cEgo.StopAllTweens(); gIconbar.StopAllTweens(); oBluecup.StopAllTweens(); // AGS 2.x TweenStopAllForCharacter(cEgo); TweenStopAllForGUI(gIconbar); TweenStopAllForObject(oBluecup);
Will stop all the tweens for cEgo, cIconbar, and oBluecup.
See Also: TweenStopAll
TweenPosition
// AGS 3.x Character.TweenPosition(float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween) GUI.TweenPosition(float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) Object.TweenPosition(float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween) Label.TweenPosition(float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween) Button.TweenPosition(float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween) TextBox.TweenPosition(float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween) ListBox.TweenPosition(float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween) Slider.TweenPosition(float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween) InvWindow.TweenPosition(float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween) // AGS 2.x TweenCharacterPosition(Character* character, float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween) TweenGUIPosition(GUI* gui, float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) TweenObjectPosition(Object* object, float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween) TweenLabelPosition(Label* label, float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) TweenButtonPosition(Button* button, float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) TweenTextBoxPosition(TextBox* textBox, float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) TweenListBoxPosition(ListBox* listBox, float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) TweenSliderPosition(Slider* slider, float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) TweenInvWindowPosition(InvWindow* invWindow, float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween)
Tweens the position of a character, GUI, object, etc. from its current position to another. Note that by default, GUI tweens are non-blocking unlike the character and object tweens.
Returns the tween duration (in loops) if the TweenStyle is non-blocking (eNoBlockTween). For a repeat TweenStyle (eRepeatTween or eRepeatReverseTween) it returns the duration of one tween cycle. For blocking tweens, it returns a 1.
Example:
// AGS 3.x cEgo.TweenPosition(2.5, 100, 100); // AGS 2.x TweenCharacterPosition(cEgo, 2.5, 100, 100);
Will tween the position of the character from its current position to x 100, y 100 in 2.5 seconds.
TweenScaling
// AGS 3.x Character.TweenScaling(float timeInSeconds, short toScale, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween) // AGS 2.x TweenCharacterScaling(Character* character, float timeInSeconds, short toScale, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween)
Tweens the scaling of a character.
Returns the tween duration (in loops) if the TweenStyle is non-blocking (eNoBlockTween). For a repeat TweenStyle (eRepeatTween or eRepeatReverseTween) it returns the duration of one tween cycle. For blocking tweens, it returns a 1.
Example:
// AGS 3.x cEgo.TweenScaling(1.5, 200); // AGS 2.x TweenCharacterScaling(cEgo, 1.5, 200);
Will tween the scaling of Ego from its current scale to 200% in 1.5 seconds.
TweenSize
// AGS 3.x GUI.TweenSize(float timeInSeconds, short toWidth, short toHeight, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) Label.TweenSize(float timeInSeconds, short toWidth, short toHeight, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) Button.TweenSize(float timeInSeconds, short toWidth, short toHeight, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) TextBox.TweenSize(float timeInSeconds, short toWidth, short toHeight, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) ListBox.TweenSize(float timeInSeconds, short toWidth, short toHeight, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) Slider.TweenSize(float timeInSeconds, short toWidth, short toHeight, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) InvWindow.TweenSize(float timeInSeconds, short toWidth, short toHeight, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) // AGS 2.x TweenGUISize(GUI* gui, float timeInSeconds, short toWidth, short toHeight, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) TweenLabelSize(Label* label, float timeInSeconds, short toWidth, short toHeight, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) TweenButtonSize(Button* button, float timeInSeconds, short toWidth, short toHeight, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) TweenTextBoxSize(TextBox* textBox, float timeInSeconds, short toWidth, short toHeight, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) TweenListBoxSize(ListBox* listBox, float timeInSeconds, short toWidth, short toHeight, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) TweenSliderSize(Slider* slider, float timeInSeconds, short toWidth, short toHeight, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) TweenInvWindowSize(InvWindow* invWindow, float timeInSeconds, short toWidth, short toHeight, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween)
Tweens the size of a GUI, Label, Button etc.
Returns the tween duration (in loops) if the TweenStyle is non-blocking (eNoBlockTween). For a repeat TweenStyle (eRepeatTween or eRepeatReverseTween) it returns the duration of one tween cycle. For blocking tweens, it returns a 1.
Example:
// AGS 3.x gStatusline.TweenSize(1.0, 50, 50); // AGS 2.x TweenGUISize(gStatusline, 1.0, 50, 50);
Will tween the size the statusline GUI from its current size to 50x50 pixels in 1 second.
TweenStopAll
// AGS 3.x and 2.x TweenStopAll()
Stops all tweens currently playing.
Example:
TweenStopAll();
Will stop whatever tweens where currently playing, whether it was a GUI, character, or room object tween.
TweenTransparency
// AGS 3.x Character.TweenTransparency(float timeInSeconds, short toTransparency, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween) GUI.TweenTransparency(float timeInSeconds, short toTransparency, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) Object.TweenTransparency(float timeInSeconds, short toTransparency, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween) // AGS 2.x TweenCharacterTransparency(Character* character, float timeInSeconds, short toTransparency, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween) TweenGUITransparency(GUI* gui, float timeInSeconds, short toTransparency, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween) TweenObjectTransparency(Object* object, float timeInSeconds, short toTransparency, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween)
Tweens the transparency of a character, GUI, or object from its current transparecy to another. Note that by default, GUI tweens are non-blocking unlike the character and object tweens.
Returns the tween duration (in loops) if the TweenStyle is non-blocking (eNoBlockTween). For a repeat TweenStyle (eRepeatTween or eRepeatReverseTween) it returns the duration of one tween cycle. For blocking tweens, it returns a 1.
Example:
// AGS 3.x oBluecup.TweenTransparency(3.0, 100); // AGS 2.x TweenObjectTransparency(oBluecup, 3.0, 100);
Will tween the transparency of the room object Bluecup to from its current value to 100% (thus fading it out).
TweenViewportX
// AGS 3.x and 2.x TweenViewportX(float timeInSeconds, short toX, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the location of the viewport on the x axis from its current location to another.
Example:
TweenViewportX(3.0, 100);
Will tween the location of the viewport on the x axis from its current location to 100.
TweenViewportY
// AGS 3.x and 2.x TweenViewportY(float timeInSeconds, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the location of the viewport on the y axis from its current location to another.
Example:
TweenViewportY(3.0, 100);
Will tween the location of the viewport on the y axis from its current location to 100.
TweenViewportXY
// AGS 3.x and 2.x TweenViewportX(float timeInSeconds, short toX, short toY, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the location of the viewport on the x axis and on the y axis from its current location to another.
Example:
TweenViewportX(3.0, 100, 20);
Will tween the location of the viewport on the x axis from its current location to 100, and on the y axis from the current locatio to 20.
TweenGamma
// AGS 3.x and 2.x TweenGamma(float timeInSeconds, short toGamma, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the screen gamma level from its current value to another. Note that System.SupportGammaControl must return true in order for this method to have any effect. Range: 0 (black) - 200 (bright)
Example:
if (System.SupportsGammaControl) { TweenGamma(3.0, 150); }
Will tween the screen gamma from its current value to 150 (which is 50% brighter than default).
TweenShakeScreen
// AGS 3.x and 2.x TweenShakeScreen(float timeInSeconds, short fromDelay, short toDelay, short fromAmount, short toAmount, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the shake screen amount and delay from one value to another. Range: Delay: from -2 to ... Amount: from 1 to 30.
Example:
TweenShakeScreen(3.0, 2, 2, 1, 15);
Will tween the shake screen amount from 1 to 15 with a constant delay of 2.
TweenMusicMasterVolume
// AGS 3.x and 2.x TweenMusicMasterVolume(float timeInSeconds, short fromVolume, short toVolume, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the master music volume from one value to another. Range: 1 - 100.
Example:
TweenMusicMasterVolume(3.0, 100, 50);
Will tween the music volume from 100 to 50.
TweenDigitalMasterVolume
// AGS 3.x and 2.x TweenDigitalMasterVolume(float timeInSeconds, short fromVolume, short toVolume, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the master digital volume from one value to another. Range: 1 - 100.
Example:
TweenDigitalMasterVolume(3.0, 100, 50);
Will tween the digital volume from 100 to 50.
TweenChannelVolume
// AGS 3.x and 2.x TweenChannelVolume(float timeInSeconds, short channel, short fromVolume, short toVolume, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the volume for a given channel from one value to another. Range: 0 - 255.
Example:
TweenChannelVolume(3.0, 1, 100, 50);
Will tween the volume for channel 1 from 100 to 50.
TweenSpeechVolume
// AGS 3.x and 2.x TweenSpeechVolume(float timeInSeconds, short fromVolume, short toVolume, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the volume for speech from one value to another. Range: 0 - 255.
Example:
TweenSpeechVolume(3.0, 100, 50);
Will tween the volume for speech from 100 to 50.
TweenSoundVolume
// AGS 3.x and 2.x TweenSoundVolume(float timeInSeconds, short fromVolume, short toVolume, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the sound effect volume from one value to another. Range: 0 - 255.
Example:
TweenSoundVolume(3.0, 100, 50);
Will tween the sound effect volume from 100 to 50.
TweenAreaScaling
// AGS 3.x and 2.x TweenAreaScaling(float timeInSeconds, short area, short fromMin, short toMin, short fromMax, short toMax, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the area scaling for a specific area from one min and max value to another. Range for min and max: 5 - 200.
Example:
TweenAreaScaling(3.0, 1, 50, 100, 100, 200);
Will tween the scaling for area 1 from 50-100 to 100-200.
TweenImage
// AGS 3.x Object.TweenImage(Object* tmpObjectRef, float timeInSeconds, short toSprite, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); // AGS 2.x TweenObjectImage(Object* object, Object* tmpObjectRef, float timeInSeconds, short toSprite, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the image of the object.
Note that this function currently requires the use of a second object for the transformation to take effect. Just create an invisible object in the room and pass it to the function (when AGS will support creating objects from code this won't be necessary).
Example:
// AGS 3.x oBlueCup.TweenImage(oTmpObject, 1.5, 167); // AGS 2.x TweenObjectImage(oBlueCup, oTmpObject, 1.5, 167);
Will tween the image of the BlueCup object from its current sprite to sprite 167.
TweenAnimationSpeed
// AGS 3.x Character.TweenAnimationSpeed(float timeInSeconds, short toAnimationSpeed, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); // AGS 2.x TweenCharacterAnimationSpeed(Character* characterRef, float timeInSeconds, short toAnimationSpeed, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the animation speed of the character.
Example:
// AGS 3.x cEgo.TweenAnimationSpeed(1.5, -100); // AGS 2.x TweenCharacterAnimationSpeed(cEgo, 1.5, -100);
Will tween the animation speed of the character from its current animation speed to -100 (which is really fast).
TweenZOrder
// AGS 3.x GUI.TweenZOrder(GUI* guiRef, float timeInSeconds, short toZOrder, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween); // AGS 2.x TweenGUIZOrder(GUI* guiRef, float timeInSeconds, short toZOrder, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween);
Tweens the Z Order of the gui.
Example:
// AGS 3.x gStatusLine.TweenZOrder(1.5, 100); // AGS 2.x TweenGUIZOrder(gStatusLine, 1.5, 100);
Will tween the Z order of the statusLine Gui from its current Z order to 100 (which is in the behind 100 other guis).
TweenLightLevel
// AGS 3.x Region.TweenLightLevel(float timeInSeconds, short toLightLevel, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); // AGS 2.x TweenRegionLightLevel(Region* regionRef, float timeInSeconds, short toLightLevel, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the light level for the region. Range: -100 (very dark) to 100 (very bright)
Example:
// AGS 3.x rGarden.TweenLightLevel(1.5, 0); // AGS 2.x TweenRegionLightLevel(rGarden, 1.5, 0);
Will tween the light level of the garden region from its current light level to 0 (which is very dark).
TweenTintR
// AGS 3.x Region.TweenTintR(float timeInSeconds, short toR, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); // AGS 2.x TweenRegionTintR(Region* regionRef, float timeInSeconds, short toR, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the Red portion for the region. Range: 0 to 255.
Note that to diminish the effect of the tint you need to set the LightLevel property for the region.
Example:
// AGS 3.x rGarden.TweenTintR(1.5, 200); // AGS 2.x TweenRegionTintR(rGarden, 1.5, 200);
Will tween the Red portion of the garden region from its current portion to 200 (which is pretty red).
TweenTintG
// AGS 3.x Region.TweenTintG(float timeInSeconds, short toG, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); // AGS 2.x TweenRegionTintG(Region* regionRef, float timeInSeconds, short toG, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the Green portion for the region. Range: 0 to 255.
Note that to diminish the effect of the tint you need to set the LightLevel property for the region.
Example:
// AGS 3.x rGarden.TweenTintG(1.5, 200); // AGS 2.x TweenRegionTintG(rGarden, 1.5, 200);
Will tween the Green portion of the garden region from its current portion to 200 (which is pretty green).
TweenTintB
// AGS 3.x Region.TweenTintB(float timeInSeconds, short toB, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); // AGS 2.x TweenRegionTintB(Region* regionRef, float timeInSeconds, short toB, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the Blue portion for the region. Range: 0 to 255.
Note that to diminish the effect of the tint you need to set the LightLevel property for the region.
Example:
// AGS 3.x rGarden.TweenTintB(1.5, 200); // AGS 2.x TweenRegionTintB(rGarden, 1.5, 200);
Will tween the Blue portion of the garden region from its current portion to 200 (which is pretty blue).
TweenTintAmount
// AGS 3.x Region.TweenTintAmount(float timeInSeconds, short toAmount, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); // AGS 2.x TweenRegionTintAmount(Region* regionRef, float timeInSeconds, short toAmount, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the amount of tint for the region. Range: 0 to 100.
Note that to diminish the effect of the tint you need to set the LightLevel property for the region.
Example:
// AGS 3.x rGarden.TweenTintAmount(1.5, 100); // AGS 2.x TweenRegionTintAmount(rGarden, 1.5, 100);
Will tween the amount of tint of the garden region from its current amount to 100%.
TweenTintBlackAndWhite
// AGS 3.x Region.TweenTintBlackAndWhite(float timeInSeconds, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); // AGS 2.x TweenRegionTintBlackAndWhite(Region* regionRef, float timeInSeconds, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the region to appear black and white.
Note that to diminish the effect of the tint you need to set the LightLevel property for the region.
Example:
// AGS 3.x rGarden.TweenTintBlackAndWhite(1.5); // AGS 2.x TweenRegionTintBlackAndWhite(rGarden, 1.5);
Will tween the garden region look from its current look to black and white.
TweenColorR
// AGS 3.x Label.TweenColorR(float timeInSeconds, short toR, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); TextBox.TweenColorR(float timeInSeconds, short toR, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); Button.TweenColorR(float timeInSeconds, short toR, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); // AGS 2.x TweenLabelColorR(Label* label, float timeInSeconds, short toR, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); TweenTextBoxColorR(TextBox* textBox, float timeInSeconds, short toR, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); TweenButtonColorR(Button* button, float timeInSeconds, short toR, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the red portion for the label, textbox or button. Range: 0 - 255
Note that to get a better result start with a color that is bigger than 30 (since 0 - 30 are reserved colors).
Example:
// AGS 3.x myLabel.TweenColorR(1.5, 200); myTextBox.TweenColorR(1.5, 200); myButton.TweenColorR(1.5, 200); // AGS 2.x TweenLabelColorR(myLabel, 1.5, 200); TweenTextBoxColorR(myTextBox, 1.5, 200); TweenButtonColorR(myButton, 1.5, 200);
Will tween the red portion of the color of the label, textbox and button from the current portion to 200 (which is pretty red).
TweenColorG
// AGS 3.x Label.TweenColorG(float timeInSeconds, short toG, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); TextBox.TweenColorG(float timeInSeconds, short toG, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); Button.TweenColorG(float timeInSeconds, short toG, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); // AGS 2.x TweenLabelColorG(Label* label, float timeInSeconds, short toG, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); TweenTextBoxColorG(TextBox* textBox, float timeInSeconds, short toG, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); TweenButtonColorG(Button* button, float timeInSeconds, short toG, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the green portion for the label, textbox or button. Range: 0 - 255
Note that to get a better result start with a color that is bigger than 30 (since 0 - 30 are reserved colors).
Example:
// AGS 3.x myLabel.TweenColorG(1.5, 200); myTextBox.TweenColorG(1.5, 200); myButton.TweenColorG(1.5, 200); // AGS 2.x TweenLabelColorG(myLabel, 1.5, 200); TweenTextBoxColorG(myTextBox, 1.5, 200); TweenButtonColorG(myButton, 1.5, 200);
Will tween the green portion of the color of the label, textbox and button from the current portion to 200 (which is pretty green).
TweenColorB
// AGS 3.x Label.TweenColorB(float timeInSeconds, short toB, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); TextBox.TweenColorB(float timeInSeconds, short toB, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); Button.TweenColorB(float timeInSeconds, short toB, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); // AGS 2.x TweenLabelColorB(Label* label, float timeInSeconds, short toB, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); TweenTextBoxColorB(TextBox* textBox, float timeInSeconds, short toB, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween); TweenButtonColorB(Button* button, float timeInSeconds, short toB, TweenTiming timing=eLinearTween, TweenStyle style=eBlockTween);
Tweens the blue portion for the label, textbox or button. Range: 0 - 255
Note that to get a better result start with a color that is bigger than 30 (since 0 - 30 are reserved colors).
Example:
// AGS 3.x myLabel.TweenColorB(1.5, 200); myTextBox.TweenColorB(1.5, 200); myButton.TweenColorB(1.5, 200); // AGS 2.x TweenLabelColorB(myLabel, 1.5, 200); TweenTextBoxColorB(myTextBox, 1.5, 200); TweenButtonColorB(myButton, 1.5, 200);
Will tween the blue portion of the color of the label, textbox and button from the current portion to 200 (which is pretty blue).
TweenValue
// AGS 3.x Slider.TweenValue(float timeInSeconds, short toValue, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween); // AGS 2.x TweenSliderValue(float timeInSeconds, short toValue, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween);
Tweens the value of the slider.
Note that the value should be between the min and max values for the slider.
Example:
// AGS 3.x mySlider.TweenValue(1.5, 200); // AGS 2.x TweenSliderValue(mySlider, 1.5, 200);
Will tween the value of the slider from the current value to 200.
TweenHandleOffset
// AGS 3.x Slider.TweenHandleOffset(float timeInSeconds, short toOffset, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween); // AGS 2.x NOT SUPPORTED
Tweens the offset of the slider handle.
Example:
// AGS 3.x mySlider.TweenHandleOffset(1.5, 20);
Will tween the handle offset of the slider from the current value to 20.
TweenSelectedItem
// AGS 3.x ListBox.TweenSelectedItem(float timeInSeconds, short toSelectedItem, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween); // AGS 2.x TweenListBoxSelectedItem(ListBox* listBox, float timeInSeconds, short toSelectedItem, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween);
Tweens the selected item for the list box.
Example:
// AGS 3.x myListBox.TweenSelectedItem(1.5, 20); // AGS 2.x TweenListBoxSelectedItem(myListBox, 1.5, 20);
Will tween the selected item of the listbox from the current value to 20.
TweenTopItem
// AGS 3.x ListBox.TweenTopItem(float timeInSeconds, short toTopItem, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween); InvWindow.TweenTopItem(float timeInSeconds, short toTopItem, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween); // AGS 2.x TweenListBoxTopItem(ListBox* listBox, float timeInSeconds, short toTopItem, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween); TweenInvWindowTopItem(ListBox* listBox, float timeInSeconds, short toTopItem, TweenTiming timing=eLinearTween, TweenStyle style=eNoBlockTween);
Tweens the top item for the list box or inventory window.
Example:
// AGS 3.x myListBox.TweenTopItem(1.5, 20); myInventory.TweenTopItem(1.5, 20); // AGS 2.x TweenListBoxTopItem(myListBox, 1.5, 20); TweenInvWindowTopItem(myInventory, 1.5, 20);
Will tween the top item of the listbox and inventory window from the current value to 20.