Friday, April 23, 2021

Edward Lance Lorilla

Edward Lance Lorilla


【JQUERY】 floating menu

Posted: 23 Apr 2021 03:07 AM PDT

【VISUAL VB.NET】Message Boxes

Posted: 22 Apr 2021 08:20 PM PDT

 Imports System

Imports System.Collections.GenericImports System.ComponentModelImports System.DataImports System.DrawingImports System.LinqImports System.TextImports System.Threading.TasksImports System.Windows.Forms' make sure that using System.Diagnostics; is included Imports System.Diagnostics' make sure that using System.Security.Principal; is included Imports System.Security.Principal Public Class Form1 Public Sub New() MyBase.New() InitializeComponent() End Sub #Region "basic function for app" Private Sub lblLink_Click_1(sender As Object, e As EventArgs) Handles lblLink.Click Process.Start("www.vclexamples.com") End Sub Protected Overrides Function ProcessCmdKey(ByRef msg As Message, ByVal keyData As Keys) As Boolean If (keyData = Keys.Escape) Then Me.Close() Return True End If Return MyBase.ProcessCmdKey(msg, keyData) End Function#End Region Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click For Each item As StringIn comboBox1.Items If comboBox1.SelectedIndex = 0 Then ' no icon MessageBox.Show(textBox1.Text, "MessageBox", MessageBoxButtons.OK) Exit For End If If comboBox1.SelectedIndex = 1 Then ' info icon ... MessageBox.Show(textBox1.Text, "MessageBox", MessageBoxButtons.OK, MessageBoxIcon.Information) Exit For End If If comboBox1.SelectedIndex = 2 Then ' question icon MessageBox.Show(textBox1.Text, "MessageBox", MessageBoxButtons.OK, MessageBoxIcon.Question) Exit For End If If comboBox1.SelectedIndex = 3 Then ' warning icon MessageBox.Show(textBox1.Text, "MessageBox", MessageBoxButtons.OK, MessageBoxIcon.Warning) Exit For End If If comboBox1.SelectedIndex = 4 Then ' error icon MessageBox.Show(textBox1.Text, "MessageBox", MessageBoxButtons.OK, MessageBoxIcon.[Error]) Exit For End If Next End Sub Private Sub button2_Click(sender As Object, e As EventArgs) Handles button2.Click Dim d As DialogResult = MessageBox.Show("Choose Yes or No", "MsgBox result", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If d = DialogResult.Yes Then MessageBox.Show("Your choice: YES", "MessageBoxExample", MessageBoxButtons.OK, MessageBoxIcon.Question) End If If d = DialogResult.No Then MessageBox.Show("Your choice: NO", "MessageBoxExample", MessageBoxButtons.OK, MessageBoxIcon.Question) End If End SubEnd Class

【VUEJS】custom multi-level single selection and multiple selection

Posted: 22 Apr 2021 08:12 PM PDT

【GAMEMAKER】Party Mechanics Changing Character

Posted: 22 Apr 2021 08:06 PM PDT

 Information about object: obj_player_parent

Sprite: spr_idle_down
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children
obj_player_1
obj_player_2
obj_player_3
Mask:
No Physics Object
Create Event:
execute code:

///set up
enum player_state {
idle,
up,
down,
left,
right
}
dir=player_state.down;
is_moving=false;
image_speed=0.5;
global.move_speed=4;

Step Event:
execute code:

///keypress code
is_moving=false;
if global.selected!=my_id exit;

if (keyboard_check(vk_left))
{
dir=player_state.left;
is_moving=true;
}
else
if (keyboard_check(vk_right))
{
dir=player_state.right;
is_moving=true;
}
else
if (keyboard_check(vk_up))
{
dir=player_state.up;
is_moving=true;
}
else
if (keyboard_check(vk_down))
{
dir=player_state.down;
is_moving=true;
}
else
{
is_moving=false;
}
execute code:

///movement
if is_moving
{
switch (dir)
{
case player_state.up:
if !position_meeting(x,y-global.move_speed,obj_solid_base) y -= global.move_speed;
break;

case player_state.down:
if !position_meeting(x,y+global.move_speed,obj_solid_base) y += global.move_speed;
break;

case player_state.left:
if !position_meeting(x-global.move_speed,y,obj_solid_base) x -= global.move_speed;
break;

case player_state.right:
if !position_meeting(x+global.move_speed,y,obj_solid_base) x += global.move_speed;
break;
}
}
depth=-y;
execute code:


///animation
if is_moving
{
switch (dir)
{
case player_state.up:
sprite_index=spr_walk_up;
break;

case player_state.down:
sprite_index=spr_walk_down;
break;

case player_state.left:
sprite_index=spr_walk_left;
break;

case player_state.right:
sprite_index=spr_walk_right;
break;
}
}
else
{
switch (dir)
{
case player_state.up:
sprite_index=spr_idle_up;
break;

case player_state.down:
sprite_index=spr_idle_down;
break;

case player_state.left:
sprite_index=spr_idle_left;
break;

case player_state.right:
sprite_index=spr_idle_right;
break;
}
}


Information about object: obj_cactus
Sprite: spr_cactus
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent: obj_elements_parent
Children:
Mask:

No Physics Object

Information about object: obj_flag
Sprite: spr_flag
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent: obj_elements_parent
Children:
Mask:

No Physics Object

Information about object: obj_mushroom
Sprite: spr_mushroom
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent: obj_elements_parent
Children:
Mask:

No Physics Object

Information about object: obj_elements_parent
Sprite:
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent:

Children
obj_cactus
obj_flag
obj_mushroom
Mask:


No Physics Object

Create Event:
execute code:

instance_create(x,y,obj_solid_base);
depth=-y;

Information about object: obj_solid_base
Sprite: spr_solid_base
Solid: false
Visible: false
Depth:
0
Persistent: false
Parent:

Children
obj_tree
Mask:

No Physics Object

Information about object: obj_selected_control
Sprite:
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent:
Children:
Mask:

No Physics Object

Create Event:
execute code:

///set up initial selection
global.selected=1;
view_object[0] = obj_player_1;
Step Event:
execute code:

///Key Press For Change Selection
if keyboard_check_released(ord('1'))
{
global.selected=1;
global.move_speed=4;
view_object[0] = obj_player_1;
}
if keyboard_check_released(ord('2'))
{
global.selected=2;
global.move_speed=6;
view_object[0] = obj_player_2;
}
if keyboard_check_released(ord('3'))
{
global.selected=3;
global.move_speed=4;
view_object[0] = obj_player_3;
}
Draw GUI Event:
execute code:

draw_text(50,50,"Keys 1 2 3 To Select - Selected Character="+string(global.selected));

Information about object: obj_tree
Sprite: spr_tree
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent: obj_solid_base
Children:
Mask:

No Physics Object

Information about object: obj_player_1
Sprite: spr_walk_down
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent: obj_player_parent
Children:
Mask:

No Physics Object

Create Event:
execute code:

my_id=1;
event_inherited();

Information about object: obj_player_2
Sprite: spr_walk_down
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent: obj_player_parent
Children:
Mask:

No Physics Object

Create Event:
execute code:

my_id=2;
event_inherited();

Information about object: obj_player_3
Sprite: spr_idle_down
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent: obj_player_parent
Children:
Mask:

No Physics Object

Create Event:
execute code:

my_id=3;
event_inherited();
Collision Event with object obj_tree:
execute code:

///destroy tree
with (other) instance_destroy();

No comments:

Post a Comment