Jump to content

Recommended Posts

Posted

Hi folks!

Does someone wants to share their widgets rendering functions^_^

Graphically I'm not very good so if anyone has some nice graphical effects (for example on the buttons) to share it would be really appreciated

I would be very interested to know how you can achieve gradient effects

 

Thank you!

 

Posted

Sadly we are having the same problem: We are engineers, not designers. Both @inmarket and I are not very good when it comes to making visually appealing designs. This is why there is no set of fancy/nicer looking default rendering routines for GWIN that could be used on more powerful systems.

@chrisjn52 is currently writing a set of minimal, old-school styled 3D rendering routines. I'm not sure what the progress is on that.

You can create gradients by using gdispBlendColors(). You can find an example in the default rendering routine of the pushbutton widget which uses a gradient background/fill unless GWIN_NEED_FLAT has been set to TRUE:

// Fill the box blended from variants of the fill color
tcol = gdispBlendColor(White, pcol->fill, BTN_TOP_FADE);
bcol = gdispBlendColor(Black, pcol->fill, BTN_BOTTOM_FADE);
dalpha = FIXED(255)/gw->g.height;
for(alpha = 0, i = 0; i < gw->g.height; i++, alpha += dalpha) {
	gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+i, gw->g.x+gw->g.width-2, gw->g.y+i, gdispBlendColor(bcol, tcol, NONFIXED(alpha)));
}

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...