[Gambas-user] Help with DrawingArea and class design

Tobias Boege taboege at ...626...
Thu Jan 17 15:24:19 CET 2013


On Thu, 17 Jan 2013, Ulrich Hartmann wrote:
> Hi all,
> 
> I'm trying to create a class which can draw a pixel-font character on screen and would let me edit the pixels (this is for my graphic lcd connected to an arduino project). So I started playing around with the Paint class in Gambas3.
> 
> So here are my questions:
> 
> If I wanted to create my own class in which I would need to draw stuff like boxes which represent the characters pixels and make them clickable to activate or deactivate pixels (eg. draw characters), which class would I use to inherit from (DrawAerea?)?
> 
> Also how would I be able to draw form within my new class when it seems to be only possible to draw in the _Draw event of the DrawingArea (can I hijack the _Draw event insde the new class inherited from DrawigArea to do the drawing)?
> 
> I guess what I want is more like my own component to display and edit a pixel character.
> 
> Tips and help would be highly appreciated!
> 
> Uli

I once wrote a program for a game project at our school to design 8*8 sqpx
sprites with a palette of 4 different colours (this system is oriented at
Nintendo's GameBoy internal workings).

The whole thing is implemented using a CTile class which works on an Image
object internally. I attached a screenshot of it. Frankly, it is not really
good for fonts, as you can see :-) Is that of the kind you want to write?

Regards,
Tobi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gtd.png
Type: image/png
Size: 11338 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20130117/5fa77596/attachment.png>


More information about the User mailing list