Linux 2d drawing tutorials
Linux 2d drawing tutorials
Hello,
Does anyone know where there are some tutorials for 2d drawing in linux or possibly some source. I know Paul at reelmedia has released some games for download but there isn't any source, so all it done was wet my appetite a little more :roll:
Does anyone know where there are some tutorials for 2d drawing in linux or possibly some source. I know Paul at reelmedia has released some games for download but there isn't any source, so all it done was wet my appetite a little more :roll:
Hostile Skies:
http://www.reelmedia.org/hs/
Tributoids:
http://www.reelmedia.org/tributoids/
Lady's Garden:
http://www.reelmedia.org/lady/
I compiled on both Windows and Linux to see how easy it was to compile code cross platform. Obviously it works great !!
http://www.reelmedia.org/hs/
Tributoids:
http://www.reelmedia.org/tributoids/
Lady's Garden:
http://www.reelmedia.org/lady/
I compiled on both Windows and Linux to see how easy it was to compile code cross platform. Obviously it works great !!

-
- User
- Posts: 57
- Joined: Sun Jan 04, 2004 2:11 pm
Do I 8O as you can see, I'm newer than a new thing when it comes to Linux, but that wasn't my descision. Anyway, when I run some code on a Win32 system it runs just fine. but when I run it on Linux I get the error : Fatal signal: Segmentation Fault (SDL Parachute Deployed)
so is the fault with the code or is the fault with SDL. or could it be something else !!
so is the fault with the code or is the fault with SDL. or could it be something else !!
The SDL.pb run just fine, and although the server doesn't have a soundcard fitted, the code itself doesn't use sound. Here's the code
As you can see, it's just displaying some text and it runs in windows with no trouble. I'm Running Red Hat 9.0
[Edit]
SDL doesn't like the command Drawingfont(fontid())
Code: Select all
; German forum:
; Author: Rings + Ses007
; Date: 23. July 2002
Procedure FlashText(Text.s,XPos,YPos,FontName.s,Fontsize,DelayTime, FontColour)
LoadFont(1, FontName, Fontsize)
For i=1 To 255 Step 3
StartDrawing(ScreenOutput())
UseFont(1)
DrawingMode(1)
DrawingFont(FontID())
FrontColor((Red(FontColour)/255*i), (Green(FontColour)/255*i), (Blue(FontColour)/255*i))
Locate (XPos,YPos)
DrawText(Text)
StopDrawing()
FlipBuffers()
If IsScreenActive()
ClearScreen(0,0,0)
EndIf
Delay(1)
Next i
Delay(DelayTime)
For i=255 To 1 Step -6
StartDrawing(ScreenOutput())
UseFont(1)
DrawingMode(1)
DrawingFont(FontID())
FrontColor((Red(FontColour)/255*i), (Green(FontColour)/255*i), (Blue(FontColour)/255*i))
Locate (XPos,YPos)
DrawText(Text)
StopDrawing()
FlipBuffers()
If IsScreenActive()
ClearScreen(0,0,0)
EndIf
Delay(1)
Next
CloseFont(1)
EndProcedure
If InitSprite() = 0
MessageRequester("Fehler", "Konnte DirectX nicht finden", 0)
End
EndIf
OpenScreen(800, 600, 16, "Netter Effeckt")
FlashText("It ...", 250, 300, "ARIAL", 40, 2000, RGB(0, 0, 255))
FlashText("... could be ...", 250, 300, "ARIAL", 40, 2000, RGB(0, 255, 255))
FlashText("... done by ...", 250, 300, "ARIAL", 40, 2000, RGB(255, 125, 255))
FlashText("Purebasic", 250, 300, "ARIAL", 60, 3000, RGB(255, 255, 255))
End
As you can see, it's just displaying some text and it runs in windows with no trouble. I'm Running Red Hat 9.0
[Edit]
SDL doesn't like the command Drawingfont(fontid())
-
- User
- Posts: 57
- Joined: Sun Jan 04, 2004 2:11 pm
Code: Select all
sh-3.00$ pbcompiler test.pb
******************************************
PureBasic Linux x86 v3.91
******************************************
Loading external modules...
Starting compilation...
69 lines processed.
Creating the executable.
- Feel the ..PuRe.. Power -
sh-3.00$ Fatal signal: Segmentation Fault (SDL Parachute Deployed)
sh-3.00$
@Paul:
did you get my code?
-
- Enthusiast
- Posts: 152
- Joined: Sun Jul 11, 2004 7:48 pm
- Location: Lillehammer, No(r)way
- Contact:
Taken from the PB v3.91 (Linux) TODO:
2DDrawing:
DrawingMode(): not supported
DrawImage(): not supported
*EDIT: And I can find the LoadFont() Command in the help file
BUT it say: Windows, AmigaOS at the bottom..
*EDIT2: Have a look here:viewtopic.php?t=11848&highlight=loadfont
Seems the fontname and stuff in linux are a bit different..
Anyway.. That's what wrong in your source. LoadFont() fails,
and then there's no FontID() etc..
2DDrawing:
DrawingMode(): not supported
DrawImage(): not supported
*EDIT: And I can find the LoadFont() Command in the help file
BUT it say: Windows, AmigaOS at the bottom..
*EDIT2: Have a look here:viewtopic.php?t=11848&highlight=loadfont
Seems the fontname and stuff in linux are a bit different..
Anyway.. That's what wrong in your source. LoadFont() fails,
and then there's no FontID() etc..
you are right, however, can someone give me a small example of drawing some large sized text on the screen, as I just can't get my head rounf the fontname and size !!!
I can get it displaying text but can't change the size of the text.
Author Message
@ olejr : thanks for pointing me in the right direction
& @ fred: any update on this as it was reported over 4 months ago !!
I can get it displaying text but can't change the size of the text.
Author Message
@ olejr : thanks for pointing me in the right direction
& @ fred: any update on this as it was reported over 4 months ago !!
-
- Enthusiast
- Posts: 152
- Joined: Sun Jul 11, 2004 7:48 pm
- Location: Lillehammer, No(r)way
- Contact:
If you do something like:
Then you pass a proper name/size in anyway..
To bad it doesn't work..
The name/size is simply ignored....!?
PS. v3.92 is in (closed) beta, so (I hope) it won't be to long before it's out..
Code: Select all
Fontrequester("", "", 0)
..
..
FlashText("SomeString", 250, 300, SelectedFontName(), SelectedFontSize(), 2000. RGB(0, 0, 255))
..
To bad it doesn't work..

The name/size is simply ignored....!?
PS. v3.92 is in (closed) beta, so (I hope) it won't be to long before it's out..