General Guidance for RogueLike Display
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
General Guidance for RogueLike Display
I'm kind of in limbo trying to figure out how to implement the graphical (or lack thereof) side of a roguelike. I want to be able to use tilesets by swapping out my png, so no plain text. My general requirements are being able to change the color shown on the background and the overlaying symbol on each tile on the fly. Do I have an easy way of doing that already in love? I know I can just set the color and draw a box for the tile background, but I want to be able to have tiles with texture (greyscale) that I can change the color of on the fly. Can someone give me a nudge in the right direction?
Re: General Guidance for RogueLike Display
If you use love.graphics.setColor then also drawing of images is affected. So, yes, you can draw all you images in grayscale and then tint them with LÖVE.
Check out my blog on gamedev
Re: General Guidance for RogueLike Display
Really? I wouldn't have even thought to try that... Well that actually answers my question 100% I'm still kind of mind blown that setColor affects drawing of images though... I'm assuming black draws the image normal, white whites it out, grey fades it, etc. I'll go experiment. Thanks.
Re: General Guidance for RogueLike Display
Full white is the normal image. Whiteout is achieved in other ways (of which I know too little to tell you). Black renders the image entirely black. Grey is indeed fading, and color overlaps the selected color with the image's regular colors.
- Hexenhammer
- Party member
- Posts: 175
- Joined: Sun Feb 17, 2013 8:19 am
Re: General Guidance for RogueLike Display
I have always used one big texture which contains the characters in all colors. You can easily calculate which part of the texture to blit with the variables being the character code and the color id. Looks like this in my current code:
This works for a texture like this:
This is the CGA 8x8 ROM font and color palette for that authentic 1980s feel but you can use any type of monospace font and palette.
As far as I know this is the fastest way to do it.
Code: Select all
self:DrawTile(
self.drawColor * self.tileset.dimensions.width + character + 1
)
This is the CGA 8x8 ROM font and color palette for that authentic 1980s feel but you can use any type of monospace font and palette.
As far as I know this is the fastest way to do it.
Who is online
Users browsing this forum: No registered users and 8 guests