Merry Christmas to all of the members of 64D! (early though)
I am submitting two examples and two scripts (read on) as presents to you all!My first example is (currently 5th in the queue) is a Color Picker. This tells you all sorts of interesting information about the color, including the Hex and CMYK. The picker is not the defualt popup!My second example is a gradient example (currently 22nd in the queue). It isn't very fast, but it does show you how gradients work.Here are the scripts;The first script is one that changes things like "Hey there!" to "hEy ThErE!". I'll just quote a post I made about it:
Quote: Me
An example of what this does, is ChIkEn AtE mY dOnUtS username. It makes every other character be uppercase/lowercase. Now I shall explain the arguments.The usage for this is "i = string_case_change(str,spacecount,first);"."str" is the string that you want to change."spacecount" is whether you want to count spaces or not. What that is meaning, is whether to count spaces as being capitalized or not (e.g. spacecount=true; "hElLo tOdAy!", spacecount=false; "hElLo ToDaY!"). This does need to be "true" or "false"."first" is meaning whether you want the first letter capitalized or not. This does need to be "true" or "false".Here is the script.
Now, here is an example (without spacecount):Input: Hello! How are you feeling at the moment?Output: hElLo! hOw ArE yOu FeElInG aT tHe MoMeNt?I hope you guys enjoy this script
/*
** usage: i = string_case_change(str,spacecount,first);
*/
var length,newstring,iii,oldstring;
oldstring='';
newstring=string(argument0);
length=string_length(argument0);
if (argument2==true || argument2==false) iii=!argument2;
else iii=false;
for (j=1; j<real(length+1); j+=1)
{
if (string_char_at(newstring,j)==' ' && argument1==false) iii=iii;
else
{
if (iii==true) { oldstring=string_lower(string_char_at(newstring,j)); newstring=string_delete(newstring,j,1); newstring=string_insert(oldstring,newstring,j); }
if (iii==false) { oldstring=string_upper(string_char_at(newstring,j)); newstring=string_delete(newstring,j,1); newstring=string_insert(oldstring,newstring,j); }
iii=!iii;
}
}
return newstring;
/*
draw_laser(x1,y1,x2,y2,maxdist);
*/
var x_new,y_new;
dir = point_direction(argument0,argument1,argument2,argument3);
for (line=1; line<argument4+1; line+=1)
{
x_new = x+lengthdir_x(line,dir);
y_new = y+lengthdir_y(line,dir);
if (!place_free(x_new,y_new) || line==argument4)
{
draw_set_blend_mode(bm_subtract);
draw_set_alpha(0.5);
draw_line_color(x,y,x_new,y_new,c_black-c_red,c_black);
draw_set_alpha(1);
draw_set_blend_mode(bm_normal);
exit;
}
}
There are already ChIkEn Script engines and color pickers.
Yeah, I know.
This color picker is more advanced than most though. ;)Oh! Now I see your comment, Polystryene Man!
That is true. [:D]<_______________________________________________
_______________________________________________<Nice comment, ChIkEn! XD
oNe qUeStIoN ThOuGh, WhY On EaRtH WoUlD I AcTuAlLy(I give uP) want this?
Hands up who has ever used a cPicker?bEcUaSe YoU wAnTeD tO mAkE yOuR gAmE lOoK fUnNy. xD
Oh yeah, and many games have cPickers.Aren't lasers made out of photons (i.e. light) while this script draws a laser that darkens the room? You can see a laser's ending position (dot) on a white surface but you can't see a laser unless the room is dark in real life. Sooo I suggest changing the blend mode