How to create curved touch sensitive areas or click on a non-square ob

1

Stats

2,220 visits, 2,989 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 18 Aug, 2015. Last updated 19 Feb, 2019

Welcome, in this tutorial to teach me my disposal an efficient way to create non-square areas to give more realism to the touch or click.

for this project we need the following objects.

I made this tutorial because I tried to create a project that wanted to click on an object, it turns out that the object is curved and transparent, by clicking on it all works perfect, but if you click outside the silhouette figure curve shown, the object also It is said to be clicked. That why when you click an object, construct 2 recognizes the overall size of the object: its full height and full width.

The image below illustrates this:

*

*

To Make this project you need this following objects:

A transparent png image showing a curved object. In my case a rugby ball. Call ball_1.png.

A sprite of blue color called touching_1 and size 25x25. Note then you must resize the various ways that cloned this cube objects must have.

A touch and / or click on the project available.

Hands-on:

Add the figure of the ball Call ball_1.png the project.

Add a text box nammed txt_listening.

Add the sprite touching_1 cube to the project.

press Ctrl + C on the sprite touching_1 and paste repeatedly positioning on Call ball_1.png several times to complete the full outline of the sprite Call ball_1.png.

Note that the smaller and more complete square curve more realistic image will be the touch and / or click, but to put too much ecessiva square Touch require more computer processing.

You need to let configured similarly to that show in this image:

*

*

Touching_1 must have the initial visibility setada as invisible.

If Touching_1 for some reason still appears on the screen seven to Opacity it to 0.

configure the touch sensor and / or click to shoot something when you click touching_1. In my case I configured to set txt_listening with the text: ten been clicked. and every 2 second with the text has not been clicked.

Set the Event Sheet to look like this:

On touched touching_1 => Set txt_listening to text: "Has been clicked"

Every 2 seconds => Set txt_listening to text: "No has been clicked"

*

*

And the end result:

*

*

Ready is this who I wanted to show, thank you for your attention.

  • 0 Comments

Want to leave a comment? Login or Register an account!