Page 1 of 1

DSB tints and other pointless questions.

Posted: Fri Jan 22, 2010 6:53 pm
by Joramun
Spoiler
(it's tints, not t*ts in the title)
First question:
I know it is possible, as demonstrated in the test_dungeon, to tint monsters with a color. I'm not sure it's making any sense, but here is my question:
Is it possible to do so with a transparency degree? (ie overlay the whole monster visible pixels with a 40% transparent green e.g.)

Second question:
To stay on a graphical theme, are there hidden base drawing functions, for example to draw a circle, disk, rectangle, pixel on screen ?
Not that i'm thinking about spreading particles everywhere or anything like that :wink:

Third question, more or less related to the first two: is it possible to make a color operation / color overlay / whatever, to have something in the same vein as the CONFLUX "Infrared vision" spell ? (which is "easy" in CSBWin because it uses DM colortab switching on a small colortab)

Re: DSB tints and other pointless questions.

Posted: Fri Jan 22, 2010 9:29 pm
by Sophia
Joramun wrote:Is it possible to do so with a transparency degree? (ie overlay the whole monster visible pixels with a 40% transparent green e.g.)
I'm not sure if I totally understand, but what I think you're referring to is that right now, when you tint a monster, it's a constant and pretty strong value, which you might not always want. If that's what you mean, it currently isn't possible to change that, but it wouldn't be difficult to add an optional additional parameter to dsb_set_tint that lets you choose this value.
Joramun wrote:To stay on a graphical theme, are there hidden base drawing functions, for example to draw a circle, disk, rectangle, pixel on screen ?
It's not 'hidden', but the only primitive directly supported by DSB is a rectangle, with the command dsb_bitmap_rect(bitmap, x1, y1, x2, y2, color, solidity). So for example, to draw a solid power pink rectangle from (0, 0) to (20, 20) on the bitmap bmp you'd do:

Code: Select all

dsb_bitmap_rect(bmp, 0, 0, 20, 20, { 255, 0, 255 }, true)
Again, if you need other basic drawing commands, they won't be that difficult to implement. You can also use dsb_bitmap_draw(src_bitmap, dest_bitmap, x, y, flip) to just directly draw one bitmap onto another.
Joramun wrote:Third question, more or less related to the first two: is it possible to make a color operation / color overlay / whatever, to have something in the same vein as the CONFLUX "Infrared vision" spell ?
I actually don't know how the Conflux spell works, so maybe I'm not thinking of it correctly, but it is not a problem to create CSBwin-style graphical overlays in DSB. You just create them (in one of your files invoked by startup.lua or wherever) as party conditions with a bitmap and no function or timer:

Code: Select all

C_OVERLAY = dsb_add_condition(PARTY, nil, bitmap, 0, nil) 
You can then toggle it on and off, by specifying 0 for off and 1 for on, with:

Code: Select all

dsb_set_condition(PARTY, C_OVERLAY, value)

Re: DSB tints and other pointless questions.

Posted: Sat Jan 23, 2010 8:16 pm
by Trantor
Sorry for spamming, but this together with the "go deep!" comment makes me wonder if I have found a fan or caused serious brain damage to Joramun... :shock:

Re: DSB tints and other pointless questions.

Posted: Sun Jan 24, 2010 2:45 am
by Joramun
Totally a fan. But I can't say my brain isn't damaged, either.

Re: DSB tints and other pointless questions.

Posted: Mon Jan 25, 2010 9:03 pm
by Joramun
Sophia wrote:I actually don't know how the Conflux spell works
It replaces the normal color palette with a new one with funny colors.

Re: DSB tints and other pointless questions.

Posted: Mon Jan 25, 2010 10:15 pm
by Sophia
Joramun wrote:It replaces the normal color palette with a new one with funny colors.
Oh. DSB doesn't use a palette, so I'm not sure how to duplicate this. Obviously there is the capacity for some post-processing of the image (tinting it black when the light level is low, for example) but there would need to be some more specific idea of just what kinds of things we wanted to do. :)