mirror of
https://github.com/PoshoDev/DexTool.git
synced 2026-08-13 13:15:32 -05:00
Reordering a bit.
This commit is contained in:
6
Project/objects/obj_button/Create_0.gml
Normal file
6
Project/objects/obj_button/Create_0.gml
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
enum but { plus, minus, method }
|
||||
|
||||
hover = false;
|
||||
pressed = false;
|
||||
inverse = 1;
|
||||
23
Project/objects/obj_button/Draw_0.gml
Normal file
23
Project/objects/obj_button/Draw_0.gml
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
if (!pressed)
|
||||
{
|
||||
var plus = 0;
|
||||
var inverse = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
var plus = height;
|
||||
var inverse = -1;
|
||||
}
|
||||
|
||||
draw_sprite_ext(sprite_index, image_index, x, y+plus, scale*length, scale*inverse, image_angle, image_blend, image_alpha);
|
||||
|
||||
draw_set_font(global.font)
|
||||
draw_set_color(color)
|
||||
draw_set_halign(halign);
|
||||
draw_set_valign(valign);
|
||||
|
||||
draw_text_transformed(x+width/2, y+height/2+plus/6, text, scale, scale, image_angle);
|
||||
|
||||
draw_set_halign(fa_left);
|
||||
draw_set_valign(fa_top);
|
||||
22
Project/objects/obj_button/Step_0.gml
Normal file
22
Project/objects/obj_button/Step_0.gml
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
if (mouse_x>x && mouse_x<x+width && mouse_y>y && mouse_y<y+height)
|
||||
{
|
||||
hover = true;
|
||||
color = c_red;
|
||||
|
||||
if (mouse_check_button_pressed(mb_left))
|
||||
pressed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
hover = false;
|
||||
color = c_white;
|
||||
}
|
||||
|
||||
if (mouse_check_button_released(mb_left))
|
||||
{
|
||||
if (hover)
|
||||
button_do(type);
|
||||
|
||||
pressed = false;
|
||||
}
|
||||
60
Project/objects/obj_button/obj_button.yy
Normal file
60
Project/objects/obj_button/obj_button.yy
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"id": "b97fbe91-98d6-26ce-4811-7421bc2b6bb3",
|
||||
"modelName": "GMObject",
|
||||
"mvc": "1.0",
|
||||
"name": "obj_button",
|
||||
"eventList": [
|
||||
{
|
||||
"id": "d6854f77-a319-ddf1-748b-cbf6e970cb22",
|
||||
"modelName": "GMEvent",
|
||||
"mvc": "1.0",
|
||||
"IsDnD": false,
|
||||
"eventtype": 0,
|
||||
"enumb": 0,
|
||||
"collisionObjectId": "00000000-0000-0000-0000-000000000000",
|
||||
"m_owner": "b97fbe91-98d6-26ce-4811-7421bc2b6bb3"
|
||||
},
|
||||
{
|
||||
"id": "fbf149ae-484d-1ba1-7dd1-2cdd91c6acc5",
|
||||
"modelName": "GMEvent",
|
||||
"mvc": "1.0",
|
||||
"IsDnD": false,
|
||||
"eventtype": 3,
|
||||
"enumb": 0,
|
||||
"collisionObjectId": "00000000-0000-0000-0000-000000000000",
|
||||
"m_owner": "b97fbe91-98d6-26ce-4811-7421bc2b6bb3"
|
||||
},
|
||||
{
|
||||
"id": "ddca3561-dcbc-dafb-84b1-31652612218a",
|
||||
"modelName": "GMEvent",
|
||||
"mvc": "1.0",
|
||||
"IsDnD": false,
|
||||
"eventtype": 8,
|
||||
"enumb": 0,
|
||||
"collisionObjectId": "00000000-0000-0000-0000-000000000000",
|
||||
"m_owner": "b97fbe91-98d6-26ce-4811-7421bc2b6bb3"
|
||||
}
|
||||
],
|
||||
"maskSpriteId": "00000000-0000-0000-0000-000000000000",
|
||||
"overriddenProperties": null,
|
||||
"parentObjectId": "00000000-0000-0000-0000-000000000000",
|
||||
"persistent": false,
|
||||
"physicsAngularDamping": 0.1,
|
||||
"physicsDensity": 0.5,
|
||||
"physicsFriction": 0.2,
|
||||
"physicsGroup": 0,
|
||||
"physicsKinematic": false,
|
||||
"physicsLinearDamping": 0.1,
|
||||
"physicsObject": false,
|
||||
"physicsRestitution": 0.1,
|
||||
"physicsSensor": false,
|
||||
"physicsShape": 1,
|
||||
"physicsShapePoints": null,
|
||||
"physicsStartAwake": true,
|
||||
"properties": [
|
||||
|
||||
],
|
||||
"solid": false,
|
||||
"spriteId": "55447b82-1730-4429-a3f8-d81a83dcacf6",
|
||||
"visible": true
|
||||
}
|
||||
Reference in New Issue
Block a user