Displaying Custom Message Boxes

This forum is meant for people to share their knowledge by writing their own tutorials for Adventure Maker.

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

Displaying Custom Message Boxes

Postby Lyberodoggy » Sat Jun 13, 2009 11:05 pm

This is an easy one. Let's say you wish to display a graphical message box that even uses transparency. All you have to do is use this code (I 'll be using the keyword filename as the picture and the keywords width and height, which should be finally replaced with numbers in pixels):

Code: Select all
Action.LoadAPicture Hotspot(0),Picture
Hotspot(0).move (Getprojectwidth-width*15)/2, (Getprojectwidth-height*15)/2, width*15 ,height*15
Hotspot(0).visible=true
text(0).visible=true
text(0).caption="your text here"
text(0).move (Getprojectwidth-text(0).width)/2, (Getprojectwidth-text(0).height*15)/2
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby reneuend » Sun Jun 14, 2009 12:28 pm

Hi Lyberodoggy,

I tested this and it seems no matter what I do, the text is behind the image. Help!
---


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

Postby Lyberodoggy » Sun Jun 14, 2009 12:35 pm

Oh, that's a problem. Well, you can replace the text with a textboxobject.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby reneuend » Sun Jun 14, 2009 1:21 pm

I tried TextboxObject, but I can't find a way to make it transparent. You would think it was possible. Isn't it just a VB TextBox? In fact, isn't Text(), just a VB Textbox? It's too bad it sits behind hotspots as this would be a very nice feature!
---


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

Postby Lyberodoggy » Sun Jun 14, 2009 4:05 pm

Text is actually VBlabel... You can create an OCX with a vblabel and arrange it in a the upper Z-order but it's too much work just for that effect...
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby pennsteve » Sun Jun 14, 2009 4:10 pm

Ok, so you could use this to make a plug-in, right? So you dont have to keep typing in code all the time. I guess I just now realized what a plug-in is. lol.

Like if I wanted to make a trivia game coupled with a room escape game, I could make a textbox plug-in so that I dont have to keep pasting the same code over and over on the frames that need it, right? Or am I wrong?
pennsteve
Expert Member
 
Posts: 329
Joined: Wed Aug 06, 2008 3:55 pm

Postby Lyberodoggy » Sun Jun 14, 2009 4:13 pm

Yeah, but in that case you could also use a set of VBS Procedures... Plugins are used to enchance the interface of AM for developers (like using extra features enabled by scripting, without any scripting at all)
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Sun Jun 14, 2009 5:41 pm

It still works..just don't move the text is all..:) Put it where u want it on the page, and when u click the hotspot..there it is..under the picture.

Although I'm missing the point of this though...no picture loads at all..I need an example..cause it stays blank and I see the text..But i'm missing when or why this would be used..

All it really looks like is a message[Text] comes up and that's it..I know u said something about transparency..but this is invisible..

What am I missin' Kiddo~ :D
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby reneuend » Sun Jun 14, 2009 10:16 pm

The text needs to be on top of the hotspot image, so you can see the text over the image. In my case, the user needs to be able to type the message during gameplay.
---


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

Postby mercedes » Sun Jun 14, 2009 11:02 pm

Oh ok..I played with it..I can see the text now...But i'm not sure if this is done right...The text was hidden before..behind the transparent hotspot..now i can at least see the text..

Should the hotspot start off transparent..? I tried it both ways..Picture in the hotspot..and hotspot transparent..I can see the text when i click it..either way now..

Only if i start off with a picture in it...it dissapears and the text appears in its stead..--which is kind of neat..lol..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby reneuend » Sun Jun 14, 2009 11:13 pm

Hey Mercedes, I'm not sure I'm following what your doing! But I have to know! were you able to get the text() to display over the hotspot image?? :)

I need like a sheet of old parchment paper image in the hotspot. Then I want to have the text() object to be on top of the hotspot so it appears there is text on it. Actually, since it's just a label and can't be multi-line, it probably is a moot point now. :( I'll have to come up with a different solution.
---


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

Postby mercedes » Sun Jun 14, 2009 11:19 pm

Well first off....

Do u start off with a picture in the hotspot? or is it transparent..and one is supposed to load..when u click it..?

I'm just curious..I know u said u were going to try something else..but this is kind of neat what i did here..haha..I'd like to follow it thru for a minute..but your right multiline doesn't work with textboxes..

Thanks..!~
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Mon Jun 15, 2009 7:03 am

Well I have to admit that the only way to display a Text (not a textboxobject) over the picture is to use the technology KG uses, to blend the picture loaded in the hotspot to the background, then remove it from the hotspot. That way you will be able to see the picture of the message box without hidding the text. We need help from ShadowHunter here...
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Lyberodoggy » Mon Jun 15, 2009 12:11 pm

Lyberodoggy wrote:Well I have to admit that the only way to display a Text (not a textboxobject) over the picture is to use the technology KG uses, to blend the picture loaded in the hotspot to the background, then remove it from the hotspot. That way you will be able to see the picture of the message box without hidding the text. We need help from ShadowHunter here...


EDIT: We can use KG to implement it. I guess...
I tried to, but I couldn't get the picture loaded in the background. Just made transparent.

I also saw this procedure in the Quick Start Guide:
BlendHotspotsWithBackgroundObject(Trigger_ID)
It should be of help
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens


Return to Post Your Own Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests