Jibble

Author Topic: Button rendering  (Read 714 times)

Eric

  • Rottwheelers
  • Posts: 1,165
    • I can help with story design
Button rendering
« on: 11 Mar 2012, 04:14 »
EDIT: Nevermind. Once I figured out that it was an alpha channel issue, I was able to turn up several forum topics about it, most helpful being
this one
, I guess, which I think says this won't work?

Back to the ol' drawin' board!

***



Above is a combination of two screenshots from the same compile of a game. The same sprites are being called in each shot. On the left, the sprites are applied to buttons. On the right, to objects in a room (in this case, a sample title screen). Is there a reason why the quality differs so wildly between the two? Is there anyway to make these sprites look better as buttons?

Below is a sample of the sprite. Probably not very visible, because it's white text on a png with an alpha channel, but I thought I'd share in case the answer somehow lay there.

« Last Edit: 11 Mar 2012, 04:53 by Eric »

Khris

  • Posts: 10,676
  • having to deal with what games are going through
    • Lifetime Achievement Award Winner
    • I can help with play testing
    • I can help with scripting
    • I can help with translating
    • Khris worked on a game that was nominated for an AGS Award!
Re: Button rendering
« Reply #1 on: 11 Mar 2012, 11:25 »
1. Make sure the game's color depth is 32bit.
1a. Re-import any sprites with alpha-channel. (transparency: leave as-is)
2. Set the GUI background color to 0.
3. Assign a 32bit-alpha channeled image as GUI background.

Here's a screenshot of my test game with the image assigned to the background and button:


(Don't ask ;D)

Eric

  • Rottwheelers
  • Posts: 1,165
    • I can help with story design
Re: Button rendering
« Reply #2 on: 11 Mar 2012, 23:37 »
Hmm...strange. I've got all of those settings, and mine still ditch the alpha channel. I've read somewhere that the problem may be where buttons completely overlap the GUI, which mine do. I'm really using the alpha'd sprites for two reasons: I'm putting them against a background that has both a gradient and a non-uniform texture (I didn't want to go through the hassle [read: was too lazy] of making sure they were all lined up pixel perfect), and because I'd planned to use the buttons in different places (title screen and pause game GUIs).

Now I've changed the design for the latter GUI, and am only using each set of sprites in one place, so it's no longer an issue. But it would probably still be useful to figure out where I went wrong.