rsscolorpicker (colorpicker)
Category: | script |
---|---|
Author(s): | vick |
Downloads: | 2336 |
Rate: | You need to be logged in to vote |
Rating: | 4 (9 Votes) |
Description:
colorpicker 1.0.2
A GUI resource you can use in your scripts for clients to specify a color.
Example of use: http://lua.pastebin.com/qDD2HFiU or http://lua.pastebin.com/xuK1C9up
Client Exported Functions:
requestPickColor(canCancel, alphaEnabled, title, r,g,b,a)
cancelPickColor()
Server Exported Functions:
requestPlayerPickColor(player, canCancel, alphaEnabled, title, r,g,b,a)
cancelPlayerPickColor(player)
Params for both sets of exported functions:
bool:canCancel - true to give the client a button to cancel selection, false = no button
bool:alphaEnabled - true to be able to set alpha value. false no alpha scrollbar
string:title - title of the colorpicker window [optional]
int:r - default red value (0-255) [optional]
int:g - default green value (0-255) [optional]
int:b - default blue value (0-255) [optional]
int:a - default alpha value (0-255) [optional]
Server Events:
"onColorPicked" source = player that picked a color
params = r,g,b,a (red,green,blue,alpha values 0-255)
"onCancelColorPick" source = player that cancelled color pick
Client Events:
"onClientPickedColor" source = player that picked color
params = r,g,b,a (red,green,blue,alpha values 0-255)
"onClientCancelColorPick" source = player that picked color
Player ElementData:
"ColorPickerActive" -- getElementData(player, "ColorPickerActive") returns true if colorpicker window is active, false otherwise
***serverside functions require a player element paramter
***events are triggered for both client and server when a color is picked or cancelled
***alpha is in number 0-255 format, in order to get a float from 0.0 to 1.0 do alpha/255
***colorpicker can be cancelled by server or client regardless of where request came from...
(more)
A GUI resource you can use in your scripts for clients to specify a color.
Example of use: http://lua.pastebin.com/qDD2HFiU or http://lua.pastebin.com/xuK1C9up
Client Exported Functions:
requestPickColor(canCancel, alphaEnabled, title, r,g,b,a)
cancelPickColor()
Server Exported Functions:
requestPlayerPickColor(player, canCancel, alphaEnabled, title, r,g,b,a)
cancelPlayerPickColor(player)
Params for both sets of exported functions:
bool:canCancel - true to give the client a button to cancel selection, false = no button
bool:alphaEnabled - true to be able to set alpha value. false no alpha scrollbar
string:title - title of the colorpicker window [optional]
int:r - default red value (0-255) [optional]
int:g - default green value (0-255) [optional]
int:b - default blue value (0-255) [optional]
int:a - default alpha value (0-255) [optional]
Server Events:
"onColorPicked" source = player that picked a color
params = r,g,b,a (red,green,blue,alpha values 0-255)
"onCancelColorPick" source = player that cancelled color pick
Client Events:
"onClientPickedColor" source = player that picked color
params = r,g,b,a (red,green,blue,alpha values 0-255)
"onClientCancelColorPick" source = player that picked color
Player ElementData:
"ColorPickerActive" -- getElementData(player, "ColorPickerActive") returns true if colorpicker window is active, false otherwise
***serverside functions require a player element paramter
***events are triggered for both client and server when a color is picked or cancelled
***alpha is in number 0-255 format, in order to get a float from 0.0 to 1.0 do alpha/255
***colorpicker can be cancelled by server or client regardless of where request came from...
(more)
Version history
Version | Publish Date | Changes | |
---|---|---|---|
1.0.2 | 2010-03-22 21:21:39 | - fixed gui not appearing correctly on some resolutions. - touched up gui a bit to take up less space on screen - added a window title parameter to requestPickColor and requestPlayerPickColor |
Download |
1.0.1 | 2010-03-21 23:52:55 | fixed small bug where cancel button would show up when it should have been disabled | Download |
1.0.0 | 2010-03-21 23:40:17 | First public release | Download |