Mercurial > traipse_dev
view orpg/map/_grid.py @ 108:e8b93e5f3721 alpha
Traipse Alpha 'OpenRPG' {091007-02}
Traipse is a distribution of OpenRPG that is designed to be easy to setup and go.
Traipse also makes it easy for developers to work on code without fear of sacrifice.
'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc's
main goal is to offer more advanced features and enhance the productivity of the user.
Update Summary:
{091006}
00:
Adds Bookmarks (Alpha) with cool Smiley Star and Plus Symbol images!
03:
Changes made to the map for increased portability. SnowDog has changes planned in Core,
though.
Added an initial push to the BCG. Not much to see, just shows off how it is re-writing
Main code.
{091007}
00:
New images added to Plugin Control Panel for Auto Start.
01:
Attempting to fix Deprecation warning from Main.
02:
Second attempt, problem in gsclient with "s.
author | sirebral |
---|---|
date | Wed, 07 Oct 2009 19:23:03 -0500 |
parents | 4385a7d0efd1 |
children |
line wrap: on
line source
import wx import orpg.dirpath from orpg.orpgCore import * from orpg.tools.rgbhex import RGBHex class GridLayer: def __init__(self, canvas): self.canvas = canvas self.RGBHex = RGBHex() def Draw(self, dc): r, g, b = self.RGBHex.rgb_tuple(self.canvas.gridColor) pen = wx.Pen(wx.Color(r, g, b, 255), 1, self.canvas.gridLines) dc.SetPen(pen) path = dc.CreatePath() if self.canvas.gridType == 'Square': self._DrawSquare(dc, path) dc.SetPen(wx.NullPen) def _DrawSquare(self, dc, path): path.MoveToPoint(0, 0) y = 0 while y < self.canvas.size[1]: path.AddLineToPoint(self.canvas.size[0], y) y += self.canvas.gridSize path.MoveToPoint(0, y) path.MoveToPoint(0, 0) x = 0 while x < self.canvas.size[0]: path.AddLineToPoint(x, self.canvas.size[0]) x += self.canvas.gridSize path.MoveToPoint(x, 0) dc.StrokePath(path)