Member
Last active 3 years ago
The easiest way would be to add the hide action to the object itself. Also make sure that your layers are in the correct order. The object should be on top, and the interactive area under it. As soon as the object is shown, it will now catch the touch, and hide itself, which allows for the interactive area to be tapped again, which creates a loop.
Cheers,
Casimir
As far as I know, a hidden object doesn't catch touches.
So, when your object is invisible, it won't recognize the tapping action.
This eplains why it works the other way around.
I'd recommend using an interactive area (which is invisible, but recognizes touches) to use as your tap-area, and then show the other object with it.
Greetings,
Casimir
Hey Phil,
I will definitely do that!
Cheers,
Casimir
Hey Phil,
In fact, I'm thinking about doing a video tutorial series on PubCoder, but in a few months, after some more experimenting.
In the meantime, if you're stuck with something, feel free to contact me at casimir.smets@icloud.com
Cheers,
Casimir
Hi guys,
Here is a sample of some code I use in JavaScript, to show only 3 of a total of 4 objects.
The trigger(PubCoder.Events.Run) are used on action lists.
var showFloorObjectsNumber = Math.floor(Math.random() * 4);
if (showFloorObjectsNumber === 0) {
$("#obj323").trigger(PubCoder.Events.Run);
} else if (showFloorObjectsNumber === 1) {
$("#obj326").trigger(PubCoder.Events.Run);
} else if (showFloorObjectsNumber === 2) {
$("#obj329").trigger(PubCoder.Events.Run);
} else if (showFloorObjectsNumber === 3) {
$("#obj332").trigger(PubCoder.Events.Run);
}
I hope this helps!
Greetings,
Casimir
Hi Angelo,
Could you explain more in-depth how I could achieve that?
Because, as far as I can see, the drag actions happen at the same time, so changing the layer of the interactive area on a drag-action won't interfere with the drag actions already happening?
Thanks for your help and time!
Greetings,
Casimir
Hi Angelo,
Yes, exactly. I previously did it in the touch down event.
Thanks for the clarification!!
Greetings,
Casimir
Hi Angelo,
Thanks for your answer!
I will definitely experiment with this!
Greetings,
Casimir
Hello,
I've created a puzzle, which works fine.
The only problem is, users are able to drag multiple objects at once (on tablets).
Is there a way to disable this? To allow only one drag action at a time?
Thanks in advance for your help and time!
With kind regards,
Casimir Smets
Hello,
The documentation states that a drag action accepts only a "drag object" action, and nothing else.
I have copied a "bring object to front" action from touch down, to the drag action.
It appears there, and it works, at least in preview, iBooks mac and iPad.
Is there a case where this doesn't work?
Is there a reason the documentation says you can't do it, but I'm still able to?
Thanks in advance for your help and time!
WIth kind regards,
Casimir Smets