object hidden in other object.

Started by adenak, Sat 19/10/2024 21:17:56

Previous topic - Next topic

adenak

hi! First of all i RTFM, but no luck at all.
I just need to hide an object let's say in a box.
The box is an object and whe i click on it's opening, revealing the other object to collect.

Since there's not z-index. how can i do something like that?
the objects are not overlapping, the hotspot are not working over objects.
What a i missing here?
Thanks so much.

Snarky

#1
Object Z-order is governed by their baselines, which by default is their y-coordinate. The heuristic is that things with a baseline further down on screen are closer.

That rule works pretty well most of the time, but when it doesn't you can override the Object.Baseline for the objects in question.

But I'm not sure this really addresses your issue, since you say the objects are "not overlapping." Are you simply asking how to hide an object and then display it? If so, you should set Object.Visible to false/true.

adenak

ok, thanks for the answer!
Let's say i have an armchair and some stuff in it.
I make an object oArm and i import 2 sprites: one if it's closed and the other for the open one.
when i click on the oArm the sprite is loaded and i see the sprite "open".
Now inside the armchair i got a pair of shoes. I need to take the shoes.
That'it, i'm stuck here. How can i make the shoes appear over the OArm object?
object over another seems not possible, so i tried painting the shoes on the arm sprite open and then using hotspot but hotspots are not drawable over object.
The only way is maybe to use the background to change... but seems not good...
Thanks again.

Crimson Wizard

#3
As Snarky have mentioned above: you need to manually set object's Baseline property.
Either do this in the Object's properties in the room editor (set BaselineOverridden first), or in script using a script command:
https://adventuregamestudio.github.io/ags-manual/Object.html#objectbaseline


adenak


SMF spam blocked by CleanTalk