Im working on a 2d game in java swing, where a procedurally generated environment is represented by a tiled array of low-res images. Currently this is all within html tags (for line breaks) in a JLabel.
On top of this, I would like to display character sprites, which will not take up an entire tile, but will have some alpha components. In the past, in JS/html and JS/canvas, I have simply made sprite tiles with alpha channels and positioned them directly above a floor tiles, using tables and/or absolute positioning.
In java swing, however, absolute positioning (and most of html for that matter) doesn't seem to work so well.
Since a sprite will never be between/overlapping two floor tiles, the obvious solution is to make a bunch of pre-computed image files outside the game -- one for each character over each type of floor tile, however, this would scale disk space (and work) exponentially with the number of images used, and seems like it shouldn't be necessary.
From what I've seen, it looks like it should be possible to create all these images in runtime as Bufferedimages, either by pre-computing them all at startup, or making some each frame as needed.
If I can do the above, I might also be able to put all the images I need into one big bitmap each frame, and display that. This could also reduce non-synchronized loading of frames if I overload the system.
Of the above options, what seems like the best? or is there another obvious solution that I am completely missing? If the solution is to make composite images, could someone point me in the right direction as far as how to do that? Thanks a lot.