forums

TNT Basic Forums > Feedback
Copy image problem
< Last Thread     Next Thread >
Author
Thread        Post A Reply

12-07-2005 16:06

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

When you copy an image using the copy image command it creates an image in the default image bank.

But you can't have an image created with a specified ID (without calling count images, deleting images, and creating blank ones, ect.). That's the problem.

This is something I relly need to be changed.

I made a little menu example that needs it badly.
The menu example lets you create any amount of custom menus with any amount of items in each menu. It looks beautiful. I don't have any images in the image bank, I create them with copy image so that they can have borders, ect.

12-07-2005 20:12

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Can't you just grab the images in the right order?

Or am I missing the point somewhat? An empty bank will begin numbering images from zero, so can't you just keep tabs on what you grab, and in what order? Does this not solve the problem?

Danny (nods)

12-07-2005 20:49

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

Well...

let's say you have 3 menus, each menu can have 100 items in it; menu #0 gets images from 0-99, menu #1 gets from 100 to 199 and so on.

And if you first call menu #43, then what?

Yes, I know I could have a variable for if every menu was opened or not, but then I would have to them all check every time I opened a menu.

It just makes the code more basic (and more understandable). : )

12-07-2005 21:35

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

OK, but if you have 300 menu items, you still need to know which one does what... So you need to keep tabs on them anyway. As long as the image value is related in some way to a piece of code which gets called when the users activates it, and to a similar check to find out which image was clicked on, I don't see that the actual number of the image has any bearing on it...

Danny (nods)

12-07-2005 21:59

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

I don't think you get what I mean...

This is how it works:

1. The program generates images for all the menu items (including hover images).

2. The user clicks and that makes a popup menu.

3. The program calls the images to draw the sprites (menu items).

4. The user hovers over the menu item, the image changes to the alredy stored selected image.

5. The user clicks on an item, making the popup menu disappar and the variable itemSelected =the item in the list that the user clicked on.

12-07-2005 22:51

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

i understand you, but i don't reckon relying on the image id to know which menu item has been clicked on is the best way to go, cause like this if you want your program to get any more complex it may not work anymore so personnaly i'd use variables to keep track of what menu items are available (however more power in "copy image" would not hurt either ;) )

12-07-2005 23:13

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

I don't rely on the image ID

I rely on the mouse x and the item ID (all items in the list are the same height).

12-08-2005 01:09

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

I finished it

At the very start I create 100,000 blank images, then replace the ones I need to change.

12-08-2005 09:22

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Just read the manual again...

quote:
Copy Image x1,y1,x2,y2,mask,shrink to i,bank


You specify the image id in the call...

quote:
x1,y1,x2,y2 specify the area of the current canvas to copy from. They are the left,top,right,and bottom co-ordinates respectively.

mask is the colour to use as transparent when the image is produced. This can be built using Make Colour.

i is the index of the image that will be produced.

shrink is a boolean value of whether or not to shrink the image just to it's contents. A value of true means that it should, a value of false means that it should be left at it's full size.

bank is the id of the bank to add the image to. If this is not specified then the current image bank is used.


I know you've finished it now, but this might save you some time.

Danny (nods)

12-08-2005 17:48

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

I don't know what you mean.
I create 100,000 blank 0 by 0 images, then delete the one I want to replace, then create an image for the menu item.

12-08-2005 21:39

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Ok, Now you've lost me...

quote:

When you copy an image using the copy image command it creates an image in the default image bank.

But you can't have an image created with a specified ID (without calling count images, deleting images, and creating blank ones, ect.). That's the problem.


Well if that's the problem, the above post must be the answer, yes?
And why are you creating 100,000 blank images and then deleting them? I don't see the logic in that at all. Just create them as you want them.

We must be talking about two different things here, for as many times as I've read this thread I still can't see what you are trying to achieve, and I've spent over twenty years writing software.
quote:

I don't rely on the image ID
I rely on the mouse x and the item ID (all items in the list are the same height).


Totally confused here. X is width, not height, and if you don't use the image ID then what's the problem?

Anyway, you've solved the problem, which is the main thing...

Danny (nods)

12-12-2005 00:11

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

Take a look at it...

I've put it in the directory.
(Once it's excepted)

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.