[FreeCiv-Java] scrollable map component & painting units, goto-lines et
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Brian,
How are you intending to handle the painting of active units, goto lines
etc?
The scrollable map component code I wrote was designed to paint a static
background. To get the best perfomance, graphics elments that tend to move
or are animated should be drawn separately. (I.e. the offscreen buffer,
TiledPainter.m_backgroundBuffer, should only store the graphics of terrain
tiles, cities, and perhaps inactive units; other elements should be painted
directly to the screen.) A good way to do this might be in the paint method
of MapComponent.java, e.g.
public void paint( Graphics g )
{
Graphics2D g2 = (Graphics2D)g;
Rectangle r = getVisibleRect();
m_painter.paint( g2, r );
//Now paint units etc here.
}
Luke
- [FreeCiv-Java] scrollable map component, Luke Lindsay, 2001/11/01
- [FreeCiv-Java] Re: scrollable map component, Brian Duff, 2001/11/02
- [FreeCiv-Java] Re: scrollable map component, Luke Lindsay, 2001/11/09
- [FreeCiv-Java] Re: scrollable map component, Brian Duff, 2001/11/11
- [FreeCiv-Java] scrollable map component & painting units, goto-lines etc,
Luke Lindsay <=
- [FreeCiv-Java] Re: scrollable map component & painting units, goto-lines etc, Brian Duff, 2001/11/13
- [FreeCiv-Java] Re: scrollable map component & painting units, goto-lines etc, Artur Biesiadowski, 2001/11/13
- [FreeCiv-Java] Re: scrollable map component & painting units, goto-lines etc, Brian Duff, 2001/11/13
|
|