| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: identify an image in |
"asd987" wrote in message
news:cnfs0o$ced$1{at}news4.zwoll1.ov.home.nl...
>
> "Rick Rothstein"
wrote in message
> news:qLidndcHc4pG7QbcRVn-sg{at}comcast.com...
>>> I'm writing the game "Memory". I display an array of
images with the
>>> coverside up. By clicking the image the real image appears. By
>> clicking the
>>> third on an image (two images are displayed now) the third image must
>> be
>>> openend and the first two images must be cocered again.
>>>
>>> My question is how I can register which image is opened and should be
>> closed
>>> again.
>>>
>>> I use an Image1(Index).Tag and can assign this to a variable when
>>> Image1_Click is performed. Must I use this in combination with
>> LoadPicture
>>> to display the coverside again? If so, how?
>>
>> If I understand the game you are creating correctly, I would probably
>> cheat and use two control arrays of ImageBox'es... one for the pictures
>> as you do now and the second for the cover side. I would place index 0
>> of the cover side array over index 0 of the display array, index 1 of
>> the cover side array over index 1 of the display array, etc. Either set
>> the cover side ImageBox'es over the display ones at design time or use
>> the ZOrder method to do so at run-time. Then I would simply show the
>> image of the underlying ImageBox by setting the covering ImageBox's
>> Visible property to False. To cover the image, set the Visible property
>> back to True. Use the fact that the indexes of the display and cover
>> ImageBox control arrays are the same (pick it up from the respective
>> Click events). As for registering which image is opened and should be
>> closed, I would use variables declared with form-wide scope; that is,
>> declare the variables in the form's (General)(Declarations) section. Two
>> for the currently opened images (store their Index values in them) and
>> another one to track the number of open images. If the number of open
>> images is two when a covering ImageBox is clicked, use the stored Index
>> values to set the Visible properties to False for those control array
>> elements.
>>
>> Rick - MVP
>>
>
> Interesting and workable solution! One question however. How can I
> retrieve the stored index values you are mentioning.
>
> Sjoerd
>
As Rick said, declare the variables in the general declarations area i.e. at
the top of the coding, and not inside any procedures. If you called the 2
variables n1 and n2 then you can use that later i.e. instead of having
image(index).tag you would have image(n1).tag and image(n2).tag. Hopefully
this is making sense to you.
---
þ RIMEGate(tm)/RGXPost V1.14 at BBSWORLD * Info{at}bbsworld.com
---
* RIMEGate(tm)V10.2áÿ* RelayNet(tm) NNTP Gateway * MoonDog BBS
* RgateImp.MoonDog.BBS at 11/18/04 9:40:15 PM
* Origin: MoonDog BBS, Brooklyn,NY, 718 692-2498, 1:278/230 (1:278/230)SEEN-BY: 633/267 270 5030/786 @PATH: 278/230 10/345 106/1 2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.