forums

TNT Basic Forums > Programming Q&A
small question about adding an interface
< Last Thread     Next Thread >
Author
Thread        Post A Reply

09-06-2003 02:29

Posted by:
JAS

Click Here to Email JAS   Find more posts by JAS

Hello,

I'm trying to get an interface into my game - two seperate images. One being artistic crap and the other being the player's health.

I've heard that you can place sprites into canvas 0 that are supposed to be interface-type-stuff, and I got it to work in the menu part of my game.

However, when I try to get the same 2 lines of code to work during the actual game It doesn't appear...

the two lines that work in the menu are placed right before the wait button click line and they are:

canvas 0
sprite 1,0,0,0

It's a big image that is pinned to the upper left corner.

Placing that code into one of the game levels yeilds no results, why is that?

I haven't even tried adding the health bar yet. ;)

Thanks in advance!

09-06-2003 14:37

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

Try putting a "draw frame" before the wait mouse click.

09-06-2003 15:28

Posted by:
JAS

Click Here to Email JAS   Find more posts by JAS

It works in the menu, but not during gameplay.

09-06-2003 16:24

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

You mentioned a wait mouse click. Could the game wait for a click instead of executing?

09-06-2003 16:34

Posted by:
JAS

Click Here to Email JAS   Find more posts by JAS

The wait mouse click is used after you've assigned buttons, so the code stops (I believe) until you click a button.

I just placed the interface code right before the wait mouse click and it works.

But, in the game loop it won't show. I'm sure it has something to do with the canvas 0 line...

09-06-2003 18:10

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

Are you sure you're using the right image bank for the sprite?

Are you sure it's not being covered by another sprite?

09-06-2003 20:30

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

If the code isn't too long, you could try and publish it here. Maybe you put a drawframe loop at te menu but not inside the loop? Or maybe you used fade down but not fade up? Or maybe the image bank isn't loaded?

09-07-2003 09:59

Posted by:
JAS

Click Here to Email JAS   Find more posts by JAS

Answers to all in no order...

Location:
Quebec ( Canada )
If the code isn't too long, you could try and publish it here. Maybe you put a drawframe loop at te menu but not inside the loop? Or maybe you used fade down but not fade up? Or maybe the image bank isn't loaded?

Unfortunately the code is pretty long, so posting it is not a good idea.
I tried placing a draw frame before, after, and inbetween the interface's code and nothing.
Fade down is not it because the game runs fine, just without an interface - though the code is there.
The image bank is loaded correctly.

I'm gonna see if I can find any source code that has an interface that I can poke around - maybe I'll find a solution there. Unless someone here has a sample? :)

Thanks for the help guys (and gals?)
!

09-07-2003 13:41

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

If the filesize doesn't exceed 500 ko you could send it to me. ( My Hotmail box is half-full so don't waste your time sending bigger files )

09-07-2003 13:42

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

Oh wait! You are using different canvases I think. When you open a canvas you must use a viewport to make it visible. Did you? If yes then end it to me.

09-08-2003 00:06

Posted by:
JAS

Click Here to Email JAS   Find more posts by JAS

It's too big... :( I'd have to crop a bunch of stuff to make it 500k...

I tried having the images drawn to canvas 2 as a sprite with transparencies and then have that drawn to canvas 0, but the transparencies don't come out... I should have figured that would happen.

I also tried just copying a portion of canvas 2 to 0 or 1, but that looked all wierd and not how I planned...

I've looked at other sources that are available and haven't found anything usefull on this subject... >>sigh<<

09-08-2003 04:42

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

I think my mail can hold a lot, so go ahead and send it to me if you want. Just make sure to compress it.

09-12-2003 10:54

Posted by:
mark_667

Location:
England

Click Here to Email mark_667   Find more posts by mark_667

Hi,
As TNT can't do menus, or normal buttons, I assume you are using sprite images for your buttons? If so, have you tried setting the sprite priority? This may be useful as it sounds like you have multiple canvases open, they may just be drawing behind the currently active one? Just a thought.

09-12-2003 23:08

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

I don't know much about your code but usually many canvases are written like this:

( in 640,480 - a frame at top, a larger frame at bottom )

open canvas 1,640,100
open canvas 2,640,380

open viewport 1,0,0 to 640,100
open viewport 2,0,100 to 640,480

while true

canvas 1
' stuff in canvas 1

canvas 2
'stuff in canvas 2


draw frame

wend

09-15-2003 10:10

Posted by:
JAS

Click Here to Email JAS   Find more posts by JAS

I think I tried that and it worked in one game, but not in the game I'm working on now...

I've pretty much set the interface problem aside until I figure out how to fix some other probs that have cropped up... ah, the life of a newb.

09-16-2003 05:16

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

quote:
As TNT can't do menus, or normal buttons

What do you mean by normal buttons?

09-16-2003 22:46

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

System buttons In guess...

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.