PDA

View Full Version : Screen Background



Queex
22-10-09, 05: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
22-10-09, 05: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.

DizzyFanUK
22-10-09, 05: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?

Colin
22-10-09, 07: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.

Queex
22-10-09, 08: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
22-10-09, 10:02 PM
I have found the 'Easier Way' (TM):

GameSet(G_MAPCOLOR,xxx);

My full implementation is:


func HandlerRoomOpen()
{
// println("HANDLER ROOMOPEN");

//insert to move background block.
roomx=GameGet(G_ROOMX);
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
22-10-09, 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!

xelanoimis
28-10-09, 08: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.