Important request..

Discussion and feedback on Construct 2

Post » Thu Jul 10, 2014 8:59 pm

Adding option to prevent the mouse or touch plugins to click on sprites will be great.

Now if you have disabled sprite collision, The mouse and touch can click on it, And you need to get around this by adding more events like delete or create sprite or activate and deactivate groups.
Image
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Thu Jul 10, 2014 9:26 pm

How would that work?
On touch sprite, sprite stop touch of sprite?
Image ImageImage
B
168
S
50
G
164
Posts: 8,239
Reputation: 105,597

Post » Thu Jul 10, 2014 9:57 pm

Just Ignore sprites that have disabled collision.
Image
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Thu Jul 10, 2014 10:39 pm

But the touch object isn't associated with objects until they are touched.
You can't say touch object ignore touch of sprite, and you can't say sprite ignore touch of touch.

You can check a Boolean and if that value, or variable is false then any sub events, such as on touch, would be ignored.
Image ImageImage
B
168
S
50
G
164
Posts: 8,239
Reputation: 105,597

Post » Thu Jul 10, 2014 10:40 pm

A0Nasser wrote:Just Ignore sprites that have disabled collision.


Just add it a viariable, boolean, true/false, and let it only be clickable when true.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
86
S
28
G
21
Posts: 1,981
Reputation: 19,316

Post » Fri Jul 11, 2014 8:20 am

Just a quick add. That's not what collisions are used for. They are used to handle the math on object on object collisions. Ideally you would disable collisions from hud anyway that they don't have to make any collision checks (hud rarery interacts with objects).
B
34
S
9
G
3
Posts: 517
Reputation: 5,206

Post » Fri Jul 11, 2014 9:57 am

If i have Sprite buttons that i don't want to be clicked, I need to use variables or deactivate groups, If the mouse can't click on disabled sprites this will be awesome and i don't need to add more events and variables to get around this.
Image
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Fri Jul 11, 2014 10:39 am

But that's not how objects work. Touch doesn't know anything about sprite, just as tiled background doesn't know anything about the text object.
It amounts to saying the same as keyboard ignore collision of sprite.
The only way it could be done is if someone made a behavior you add to the object you don't want touched, and that would probably take a lot of code, where you can add a variable in one click, and add one event.
Image ImageImage
B
168
S
50
G
164
Posts: 8,239
Reputation: 105,597

Post » Fri Jul 11, 2014 12:22 pm

newt wrote:Touch doesn't know anything about sprite


@newt - That's not exactly true since there is an "On touched object" condition, so it must use the objects collision polygon and position to determine if the touch occurred in that area

All I think @A0Nasser wants is for On touched object to only return true if the object is touched while it has collisions enabled and always false if collisions are disabled, which only seems logical.

Same goes for the Mouse On object clicked condition.

newt wrote:The only way it could be done is if someone made a behavior you add to the object you don't want touched, and that would probably take a lot of code,

It wouldn't take much code. All it would take is for @Ashley to add in where On touched object/On object clicked normally returns true a check like this:
Code: Select all
if Object.isSprite then
   return Object.collisionsEnabled
else
   return true
end

One workaround is simply to add in the sprite's Collisions enabled condition in the events with the On touched object/On object clicked condition, and turn on/off collisions as needed. See example capx
Vote for all the Construct 2 games on Steam Greenlight - Find them here
B
32
S
9
G
7
Posts: 444
Reputation: 6,731

Post » Fri Jul 11, 2014 1:24 pm

And what if you did need to know if that object was touched?
Touch, and collision are two different things.
Having the extra layer just complicates things where the variable method, which is how most everything else works doesn't add much overhead.
Image ImageImage
B
168
S
50
G
164
Posts: 8,239
Reputation: 105,597

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest