Resize hotspot in runtime>?

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Resize hotspot in runtime>?

Postby mercedes » Tue May 24, 2011 1:02 am

I'm trying to re-size and move my hotspot in runtime ..and i forget :oops:

I know its something like this ;

Action.LoadAPicture Hotspot(1), "Top_drawer.bmp"
Hotspot(1).move x(), y() and then...this is where i forget..

I want it in the center of screen..It's rather big..the size i want it too..

It's like starting all over again..it's been too long..If i had my other games..on this pc..i could refer back to them..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby reneuend » Tue May 24, 2011 3:26 am

Hi Mercedes!

Is this what you need?

Code: Select all
Hotspot(index).Move Xpos*15,YPos*15


To get the center of the screen:

Code: Select all
XCenter = Action.GetDisplayResolutionX / 2
YCenter = Action.GetDisplayResolutionY / 2
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Tue May 24, 2011 4:50 am

Actually...I forgot about the HELP section..derr..It's right in there..the move code..

***********
I can't seem to find this though....I can..but its not the exact same..I need a nudge..

Once the person finds all 9 items..and they are crossed out..which can be random..

I want to load the 2 hotspots then..Letting them know they found the 1 item in the junk pile-[picture loads-of the one item..]

..And with the OK button...take them to a new frame..
Like a hidden object game..

I'll keep browsing the forum..cause i know there's something here for it..It helps to know the user who posted it...
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby reneuend » Tue May 24, 2011 12:06 pm

There are different ways to track the 9 items. Here is one. Create a variable to keep track of the count (nNumItems). When the user picks up one of the 9 items add this code:

Note: I'm assuming that the 9 items, hotspots to display after the 9 items found, and the OK button to display after the 9 items are found are all on the same frame.

Code: Select all
nNumItems = nNumItems + 1
if nNumItems >= 9 then
    'Display message
    'Display the hotspot of item in junkpile
    'Display the OK button
end if
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Tue May 24, 2011 9:31 pm

Thank you Renuend!..:D

However..I was wondering if you could help me fix this or tell me whats wrong with it..

I was at it last night...And I used this code here; For some reason it only works for some of the items..usually 2-3

It worked fine up until i added the event and move code?
I wasn't sure how to load 2 pictures at once..hence the :


There are 9 items-to be clicked and the hotspots are disabled and picture dissappears--- as well as the text.--Top half of the code.

The 2 pictures that load..after...all are gone..are the ones being moved and resized.
They never come into effect..because only 3 items..Sometimes only 2 dissappear. All the others..do nothing..

I have this in all 9 hotspots.


Code: Select all
Text(4).caption = ""
Action.CreateTimedEvent 0.03, "Text(13).Caption = ""Hammer"""
Action.LoadAPicture Hotspot(1), ""

hspot = hspot - 1
If hspot = -9 Then Action.LoadAPicture Hotspot(18), "Hammer.gif" : Action.LoadAPicture Hotspot(19),"OK.bmp"

Hotspot(18).Move 187*15,22*15,480*15,354*15
Hotspot(19).Move 325*15,390*15,128*15,128*15



I'm using yours..But I'm curious whats wrong with mine..

Why would only 2 or 3 hotspots work..>?
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby reneuend » Wed May 25, 2011 1:39 am

You're right. It makes no sense. If you could share or send me the code, I'll give you an answer! :-)

It's nice to see that you are back at building a game. I'd be glad to help.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Wed May 25, 2011 2:09 am

reneuend wrote:You're right. It makes no sense. If you could share or send me the code, I'll give you an answer! :-)


That's the code right there..in my post...What do u mean..?

Although, I'm using yours in the end..I was just curious as to why it was doing that ...


It's nice to see that you are back at building a game. I'd be glad to help.


yeah....I look forward to this one..and Thank You!

This time I did things differently.....I wrote the puzzles down..and how to finish them..

So much easier that way..
Before..I would make out scenes..pictures..icons..Go nuts with drawings..and want to use each and every plugin..

Then i would import everything...and be lost...and really overwhelmed..lol

I love to draw..I find it relaxing..and I would get ahead of myself with drawings..especially frames and icons/inventory..
...I don't know why..
Puzzles don't really require alot of icons....
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron