Posted by member 128640 on 2004-05-04 17:34:27 link

thanks, finally I did it with a var containing the bang value... same work as your last code RabidCow...

I post here the code :

in theme.rc
*SkinBox sliderbg1 0 0 256 13 #1tl
sliderbg1x 50
sliderbg1y 100
sliderbg1bitmap slider_bg.png
sliderbg1Tile true


in theme.mz
*script bang !tohSliderInit
*script exec !SkinBoxCreate %{\1}Knob 50 50 8 13 #1tl
*script exec !SkinBoxBitmap %{\1}Knob slider_knob.png
*script exec !skinboxexec %{\1} !varset lpx {@ix}
*script exec !skinboxexec %{\1} !varset lpy {@iy}
*script exec !skinboxexec %{\1} !varset hpx {@isx}
*script exec !skinboxexec %{\1} !varadd hpx %{lpx}
*script exec !SkinBoxAction %{\1}Knob LButtonDown !knobdrag %{\1}Knob
*script exec !SkinBoxAction %{\1}Knob LButtonUp !knobdragstop %{\1}Knob
*script exec !SkinBoxMove %{\1}Knob %{lpx} %{lpy}
*script exec !varSet tohaction %{\2}
*script exec !varSet tohvictime %{\3}
*script ~bang

; !knobdrag [skinboxname] [skinbox"parent"name]
; x, y, dx, dy modified

*script bang !knobdrag
*script exec !skinboxexec %{\1} !varset dx {@mx}
*script exec !skinboxexec %{\1} !varset dy {@my}
*script exec !timerupdate drag #l 75 '!knobdragloop %{\1}'
*script exec !timerstart drag
*script ~bang


*script bang !knobdragloop
*script exec !skinboxexec %{\1} !varset %{\1}x {@mxs}
*script exec !skinboxexec %{\1} !varset %{\1}y {@iys}
*script exec !varadd %{\1}x -%{dx}
*script exec !varset x {%{\1}x}
*script exec !varset x %%{x}
*script exec !ifEval ("%{x}" &gt "%{hpx}") !varset x %{hpx}
*script exec !ifEval ("%{x}" &lt "%{lpx}") !varset x %{lpx}
*script exec !skinboxexec %{\1} !varset posactuelle %{x}
*script exec !varset y {%{\1}y}
*script exec !varset y %%{y}
*script exec !skinboxmove %{\1} %#%{x}-resolutionx%# %#%{y}-resolutiony%#
*script ~bang


*script bang !knobdragstop
*script exec !timerkill drag
*script exec !varadd posactuelle -%{lpx}
*script exec %{tohaction} %{tohvictime} %{posactuelle}
*script ~bang


*script start !tohSliderInit sliderbg1 !SkinBoxAlpha Skinboxtomodify

;*script start !tohSliderInit [nameoftheslider] [action to do when release] [Skinboxtomodify]


This code is a compilation of the script from RabidCow and the script from Smurth for dragging skinboxes.

I do not hook the knob for keeping full alpha possibilities.

It's working well for the Alpha... but... need RabidCow to implement Hue, Saturation and Color replacement on the SkinBox now :D

btw thank you all for your help !