Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* between
- This value checks if valcheck is between val1 and val2, if so it returns true.
- */
- function between(valcheck,val1,val2)
- {
- if valcheck>val1 and valcheck<val2
- {
- return true;
- }else{return false}
- }
- function equalBetween(valcheck,val1,val2)
- {
- if valcheck>=val1 and valcheck<=val2
- {
- return true;
- }else{return false}
- }
- /* bool_to_string
- 0??, 1?? Just tell me if it is true or false!
- Converts real number 1 or 0 to string true or false
- */
- function bool_to_string(value){
- switch (real(value))
- {
- case 0:
- return "false"
- break;
- case 1:
- return "true"
- break;
- default:
- return "Not a boolean."
- break;
- }
- }
- /* draw_rectangle_thick
- Draw a rectangle with outline borders that you can modify
- */
- function draw_rectangle_thick(x1,y1,x2,y2,color,width){ //This might need optimization
- draw_set_color(color)
- draw_rectangle(x1,y1,x2,y2,true)
- var i = 0
- do
- {
- i += 1
- draw_rectangle(x1-i,y1-i,x2+i,y2+i,true)
- }
- until(i = width)
- }
- /* draw_text_outline
- This is the quick solution to adding outlines to your text without using shaders, it takes the same arguments as a normal draw_text_color
- but adds the color_outline argument, for the color of the outline and the outline_big argument to check how big the outline is going to be.
- That last argument kinda depends on how big your font is, if you use a value excesively higher it might look bad, as I said, this is the quick
- solution to adding outlines to your text, gotta play around with that value, usually, a value from 1 to 3 will look good in any font.
- */
- function draw_text_outline(x_,y_,string_,color1,color2,color3,color4,color_outline,outline_big,alpha_){
- draw_text_color(x_+outline_big,y_,string_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+
- draw_text_color(x_,y_+outline_big,string_,color_outline,color_outline,color_outline,color_outline,alpha_) //Y+
- draw_text_color(x_-outline_big,y_,string_,color_outline,color_outline,color_outline,color_outline,alpha_) //X-
- draw_text_color(x_,y_-outline_big,string_,color_outline,color_outline,color_outline,color_outline,alpha_) //Y+
- draw_text_color(x_+outline_big,y_+outline_big,string_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+ Y+
- draw_text_color(x_-outline_big,y_-outline_big,string_,color_outline,color_outline,color_outline,color_outline,alpha_) //X- Y-
- draw_text_color(x_+outline_big,y_-outline_big,string_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+ Y-
- draw_text_color(x_-outline_big,y_+outline_big,string_,color_outline,color_outline,color_outline,color_outline,alpha_) //X- Y+
- draw_text_color(x_,y_,string_,color1,color2,color3,color4,alpha_)
- }
- function draw_text_ext_outline(x_,y_,string_,sep_,w_,color1,color2,color3,color4,color_outline,outline_big,alpha_){
- draw_text_ext_color(x_+outline_big,y_,string_,sep_,w_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+
- draw_text_ext_color(x_,y_+outline_big,string_,sep_,w_,color_outline,color_outline,color_outline,color_outline,alpha_) //Y+
- draw_text_ext_color(x_-outline_big,y_,string_,sep_,w_,color_outline,color_outline,color_outline,color_outline,alpha_) //X-
- draw_text_ext_color(x_,y_-outline_big,string_,sep_,w_,color_outline,color_outline,color_outline,color_outline,alpha_) //Y+
- draw_text_ext_color(x_+outline_big,y_+outline_big,string_,sep_,w_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+ Y+
- draw_text_ext_color(x_-outline_big,y_-outline_big,string_,sep_,w_,color_outline,color_outline,color_outline,color_outline,alpha_) //X- Y-
- draw_text_ext_color(x_+outline_big,y_-outline_big,string_,sep_,w_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+ Y-
- draw_text_ext_color(x_-outline_big,y_+outline_big,string_,sep_,w_,color_outline,color_outline,color_outline,color_outline,alpha_) //X- Y+
- draw_text_ext_color(x_,y_,string_,sep_,w_,color1,color2,color3,color4,alpha_)
- }
- function draw_text_transformed_outline(x_,y_,string_,xscale_,yscale_,angle_,color1,color2,color3,color4,color_outline,outline_big,alpha_){
- draw_text_transformed_color(x_+outline_big,y_,string_,xscale_,yscale_,angle_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+
- draw_text_transformed_color(x_,y_+outline_big,string_,xscale_,yscale_,angle_,color_outline,color_outline,color_outline,color_outline,alpha_) //Y+
- draw_text_transformed_color(x_-outline_big,y_,string_,xscale_,yscale_,angle_,color_outline,color_outline,color_outline,color_outline,alpha_) //X-
- draw_text_transformed_color(x_,y_-outline_big,string_,xscale_,yscale_,angle_,color_outline,color_outline,color_outline,color_outline,alpha_) //Y+
- draw_text_transformed_color(x_+outline_big,y_+outline_big,string_,xscale_,yscale_,angle_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+ Y+
- draw_text_transformed_color(x_-outline_big,y_-outline_big,string_,xscale_,yscale_,angle_,color_outline,color_outline,color_outline,color_outline,alpha_) //X- Y-
- draw_text_transformed_color(x_+outline_big,y_-outline_big,string_,xscale_,yscale_,angle_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+ Y-
- draw_text_transformed_color(x_-outline_big,y_+outline_big,string_,xscale_,yscale_,angle_,color_outline,color_outline,color_outline,color_outline,alpha_) //X- Y+
- draw_text_transformed_color(x_,y_,string_,xscale_,yscale_,angle_,color1,color2,color3,color4,alpha_)
- }
- /* draw_text_shadow
- This takes the same arguments as a draw_text_color but also adds the color_shadow argument (The color for your shadow),
- pos_shadow_x, the X direction for the shadow (Can also be negative) and the
- pos_shadow_y, the Y direction for the shadow (Can also be negative)
- */
- function draw_text_shadow(x_,y_,string_,color1,color2,color3,color4,color_shadow,pos_shadow_x,pos_shadow_y,alpha_){
- draw_text_color(x_+pos_shadow_x,y_+pos_shadow_y,string_,color_shadow,color_shadow,color_shadow,color_shadow,alpha_)
- draw_text_color(x_,y_,string_,color1,color2,color3,color4,alpha_)
- }
- function draw_text_ext_shadow(x_,y_,string_,sep_,w_,color1,color2,color3,color4,color_shadow,pos_shadow_x,pos_shadow_y,alpha_){
- draw_text_ext_color(x_+pos_shadow_x,y_+pos_shadow_y,string_,sep_,w_,color_shadow,color_shadow,color_shadow,color_shadow,alpha_)
- draw_text_ext_color(x_,y_,string_,sep_,w_,color1,color2,color3,color4,alpha_)
- }
- function draw_text_transformed_shadow(x_,y_,string_,xscale_,yscale_,angle_,color1,color2,color3,color4,color_shadow,pos_shadow_x,pos_shadow_y,alpha_){
- draw_text_transformed_color(x_+pos_shadow_x,y_+pos_shadow_y,string_,xscale_,yscale_,angle_,color_shadow,color_shadow,color_shadow,color_shadow,alpha_)
- draw_text_transformed_color(x_,y_,string_,xscale_,yscale_,angle_,color1,color2,color3,color4,alpha_)
- }
- /* instance_create_once
- Shortcut for creating an instance when that instance doesn't exist yet, basically it just creates it once.
- */
- function instance_create_depth_once(x_,y_,depth_,obj_,struct_=false){
- if !instance_exists(obj_)
- {
- var idToReturn=instance_create_depth(x_,y_,depth_,obj_,struct_)
- return idToReturn.id
- }
- }
- function instance_create_layer_once(x_,y_,layer_,obj_,struct_=false){
- if !instance_exists(obj_)
- {
- var idToReturn=instance_create_depth(x_,y_,layer_,obj_,struct_)
- return idToReturn.id
- }
- }
- /* print
- Who in YoYo Games thought that it was a good idea to make the print function "show_debug_message"?
- That word is too long and I'm too lazy to write all of that everytime I want to print something.
- */
- function print(string_){
- show_debug_message(string_)
- }
- //And for the lazier ones:
- function p(string_){
- show_debug_message(string_)
- }
- /* scr_speedhack
- Script must be on step event or similar.
- hile you're pressing the key assigned in the key argument your room speed
- will be whatever you put in the velocity argument, this will make your game go faster.
- This is useful for playtesting.
- !HIGH VELOCITY VALUES MIGHT MESS UP WITH THE GAME WHEN SPEEDHACKING!
- A good value range is between 10 and 6000
- Usually anything below 60 is slowmo.
- The blue ball moving at the bottom is to check the room speed.
- */
- function scr_speedhack(key,velocity){
- if keyboard_check(key)
- {
- room_speed=velocity
- }else{room_speed=60} //CHANGE THIS TO WHATEVER YOUR NORMAL ROOM SPEED IS
- }
Add Comment
Please, Sign In to add comment