Screen Background

Need help with using DizzyAGE then look here
Post Reply
Queex
Hard Boiled Egg
Posts: 124
Joined: Thu Oct 22, 2009 5:04 pm

Screen Background

Post by Queex » Thu Oct 22, 2009 5:12 pm

I've started putting a short test game together to get the hang of DizzyAGE, but I'm wondering if there's an easy way of changing the background colour of the screens away from black. Ideally, I'd like to be able to set the colour on a room by room basis, but I'll take what I can get.

delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Post by delta » Thu Oct 22, 2009 5:29 pm

the best way to do it is simply to put a colour block in the map, set as 'Static' brush, and 'img only' material.

as far as i know, there is no way to do it in the code.
Image

Image

"Quotes from the internet may not be genuine" - Abraham Lincoln

DizzyFanUK
Hard Boiled Egg
Posts: 606
Joined: Tue Mar 18, 2008 11:20 am
Location: Brentwood, Essex, UK

Post by DizzyFanUK » Thu Oct 22, 2009 5:33 pm

Im pleased someone asked this - cos i been wonderin too.

I think the background colour isnt the problem - i think the issue is the standard tile set
- so for example, the standard tile for trees could be set as semi transparent, with the colour background blending horribly, or they could be set to keep the black bits which is also noticeable.

So i presume the answer is to create your own custom tiles? which can be time consuming.

Any others with advice?

Or how did it work on something like Excalibur Dizzy?
:v2_dizzy_thumbsup:Long Live Dizzy - May his boxing gloves never shrink in the wash :v2_dizzy_biggrin:

Colin
Hard Boiled Egg
Posts: 594
Joined: Mon May 28, 2007 8:34 am
Location: Worthing, West Sussex, UK

Post by Colin » Thu Oct 22, 2009 7:10 pm

well, you can change the whole map background colour. it's under options in the editor.

as DizzyFanUK said though, all the tile sets would need to be altered to stop the background colour bleeding through the tiles

excalibur dizzy used large tiles of gradient colour for the sky.

I would go with Jamie's suggestion.
ImageImageImage

Queex
Hard Boiled Egg
Posts: 124
Joined: Thu Oct 22, 2009 5:04 pm

Post by Queex » Thu Oct 22, 2009 8:38 pm

I've actually been touching up the default graphics, making each of them a 2-colour version to keep the original feel.

I'm going to try creating a screen-sized block, initially somewhere out of the way, and trying to insert a line before the specific room callback that moves the block to the current screen and changes its colour based on one of the room properties.

It's more hacking than I was going to do with the test game, but It'll be useful later I'm sure.

Of course, I'll need to make sure it's behind everything else, but it's probably worth a try.

:egg:

Queex
Hard Boiled Egg
Posts: 124
Joined: Thu Oct 22, 2009 5:04 pm

Post by Queex » Thu Oct 22, 2009 10:02 pm

I have found the 'Easier Way' (TM):

GameSet(G_MAPCOLOR,xxx);

My full implementation is:

Code: Select all

func HandlerRoomOpen()
{
	// println("HANDLER ROOMOPEN");
	
	//insert to move background block.
	roomx=GameGet(G_ROOM X) ;
	roomy=GameGet(G_ROOMY);
	UpdateBackground(RoomGet(roomx,roomy,7));
	fid = gs_fid( "OpenRoom_"+(str)roomx+"_"+(str)roomy);
	if(fid!=-1) call(fid);
}

func UpdateBackground(colorIndex)
{
  if(colorIndex==1){
      col=COLOR_BLACK;
    } else {
      col=0xff8888ff;
    }
    GameSet(G_MAPCOLOR,col);
}
This uses room property 7 as an index to colours you set in the second function, with a default. Programmatic changes can be made to the property, which is triggered when the room is entered, and changes made by directly calling the function. Should cover all the bases. Using indices means you don't have to change a whole lot of properties if you want to change the shade.

delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Post by delta » Thu Oct 22, 2009 10:35 pm

well i never! you learn something new everyday! *doffs hat*

To be fair, i've never tried, and i was pressed for time, so didn't look! :p that's my excuse anyway!
Image

Image

"Quotes from the internet may not be genuine" - Abraham Lincoln

xelanoimis
Team Yolkfolk
Team Yolkfolk
Posts: 1014
Joined: Sun Jan 21, 2007 6:34 pm
Contact:

Post by xelanoimis » Wed Oct 28, 2009 9:57 pm

Yep, G_MAPCOLOR it is :)
Always check the manual, and have a look in the index for words starting with G_ (for GameSet/Get), B_ and O_ (for brush/object properties), P_ (for player properties), etc.

Post Reply