Quote:
Originally Posted by Alpho
PHP Code:
with (HBUI_Point0) { join("plugin_tween"); tween("x", 1, x, x+50); }
That's called upon clicking a gui button.
HBUI_Point0 is a GuiShowImgCtrl.
|
Something like this should work:
PHP Code:
new GuiShowImgCtrl("HBUI_Point0") {
profile = GuiDefaultProfile;
image = "block.png";
height = 32;
width = 32;
x = 300;
y = 300;
this.join("plugin_tween");
}
...
HBUI_Point0.tween("x", 1, HBUI_Point0.x, HBUI_Point0.x + 50);
The only thing is that you'll have to edit the class so that tween() is a public function so that it can be accessed by the object. Here it is:
PHP Code:
//#CLIENTSIDE
public function tween(value, time, oldval, newval) {
temp.dist = newval - oldval;
temp.step = temp.dist / time * 0.05;
this.( @ value) = oldval;
this.trigger("TweenValue", value, temp.step, newval);
}
function onTweenValue(value, step, newval) {
cancelEvents("TweenValue");
if (this.(@ value) == newval) return this.trigger("TweenFinished", value);
this.( @ value) += step;
scheduleEvent(0.05, "TweenValue", value, step, newval);
}