Making characer appear when a inventory item passes over them

Started by Dervish, Thu 25/09/2008 21:17:03

Previous topic - Next topic

Dervish

ok so this is some what similar to this post http://www.adventuregamestudio.co.uk/yabb/index.php?topic=28311.0

but a little different I don't want to use just a look icon I want to use an inventory item and the character is completely invisible until you pass the item over the hidden character also I think it would be neat to have some sort of screen effect where the the circle of the magnifying glass is clear and everything else on the screen is faded or something to that effect. just curious on how that might be accomplished.

Dervish

Ok since I guess people have missed this I am replying to bump it but I also have a new question.

I am going to make basically the idea of a flashlight using a gui, but I want to know is there anyway to either make the gui semitransparent so that the player can still see the screen it is just darkened and the circle area is completely transparent

Khris

I tried to decode your first post, but I gave up.

The second question is easy: create a big, black sprite with a hole inside, set it as a GUI's background image, then set the GUI's transparency to e.g. 50.

Akatosh

From what I understand, you want to have a character that is completly invisible (but still interactable) until the player uses an inventory item on him... right? Simple enough. Just put this in game_start or somewhere appropiate:

Code: ags

cGigglesticks.Transparency=100; //replace cGigglesticks with the right name


and something like this in the character's "player uses inventory item on character" interaction:

Code: ags

if (player.ActiveInventory==iWagglestaff) {
cGigglesticks.Transparency=0;
cGigglesticks.Say("I arse teh visible!!1");}


Well, you get the idea.

Dervish

Thanks for the help I have it somewhat working but in making basically the flashlight type gui I am not able to change the gui size to over 320X200 is this becuase I am using 2.72 version or am I just doing something incorrectly? Any help would be great.

Akatosh

No, GUIs always use 320x200 coordinates AFAIK. A 320x200 GUI will cover your screen just fine.

Khris

Dervish, you got a point there. I think a few years back, when I implemented this, I didn't use a GUI but an object. The downside is that you'd have to create a dummy object in every room.

Having said that, if you keep the GUI at 320x200, covering the whole screen, and draw the GUI's background image yourself every loop, it should work. Loop up DynamicSprites and DrawingSurfaces.

Dervish

Ok so if I go the GUI route my game is 640x480 and I made an image twice that size 1280X960 for the flashlight gui. Is there no way I can just move the background image of gui without moving the actual gui just the image that is inside?

SMF spam blocked by CleanTalk