IonicWind Software

IWBasic => General Questions => Topic started by: Andy on May 05, 2021, 04:05:06 AM

Title: Region buttons
Post by: Andy on May 05, 2021, 04:05:06 AM
Hi,

Can someone tell me what's wrong here:

I'm working on region buttons, (project build), when I do this...

CONTROL w1,@RGNBUTTON,"",450,150,50,20,0x50000000,2
uint hrgn1[1] = rgnfrombitmap(585)
SETBUTTONRGN w1,2,hrgn1[1]
SETBUTTONBITMAPS w1,2,bmp,bmp,0
SETBUTTONBORDER w1,2,0

the bitmap is shown correctly.

But when I do this it doesn't...

CONTROL w1,@RGNBUTTON,"",450,150,50,20,0x50000000,2
hrgn[1] = rgnfrombitmap(585)
SETBUTTONRGN w1,2,hrgn[1]
SETBUTTONBITMAPS w1,2,bmp,bmp,0
SETBUTTONBORDER w1,2,0

I have hrgn defined as UINT hrgn[100]

Andy.
Title: Re: Region buttons
Post by: Andy on May 05, 2021, 05:35:59 AM
This is very strange.

If I say:

hrgn = rgnfrombitmap(585)

then use

SETBUTTONRGN w1,2,hrgn - it's not shown - well only a small dot.

If I use

SETBUTTONRGN w1,2,hrgn[1234] (any number > 0) it's shown correctly?
Title: Re: Region buttons
Post by: Andy on May 05, 2021, 05:48:13 AM
The problem is this:

If I have say 100 images, at the moment I would need 100 UINT's.

Okay, I can work with that but surely there is a way to make just one UNIT store  all the regions?

Andy.
Title: Re: Region buttons
Post by: Brian on May 05, 2021, 05:50:15 AM
Andy,

Look at your Hangman game to see how you loaded multiple region buttons

Brian
Title: Re: Region buttons
Post by: Andy on May 05, 2021, 06:05:16 AM
Thanks Brian,

There I am doing exactly what I want to do here except they are all the same shape in the game.

It doesn't work here, I have double checked my include file and there's nothing there that would cause this.

Andy.

 
Title: Re: Region buttons
Post by: LarryMc on May 05, 2021, 01:48:03 PM
I tried everything I know to try and I don't know why it isn't working.
Sorry
Title: Re: Region buttons
Post by: Andy on May 05, 2021, 11:09:38 PM
Thanks for trying.

Got up this morning determined to find out the problem.

There were actually two things going on,

1. For some reason when I use the colour black the bitmap goes transparent (no idea), this is not an issue but still a puzzle.

2. There was a control number conflict buried deep inside a sub routine, so I changed one of my control numbers.

So changing the control number and bitmap colour solved this little one - phew!

Thanks,
Andy.
:)