Search found 141 matches
- Thu Jan 09, 2025 6:40 pm
- Forum: Tricks 'n' Tips
- Topic: IlluminatedSprite - Lighting effects with sprites only
- Replies: 5
- Views: 2180
Re: IlluminatedSprite - Lighting effects with sprites only
Thanks, STARGÅTE! This is great - and looks fantastic!
- Tue Dec 31, 2024 9:48 pm
- Forum: Coding Questions
- Topic: how to view a CHM file?
- Replies: 21
- Views: 6086
Re: how to view a CHM file?
Awesome, infratec! nice work!
- Wed Nov 27, 2024 10:13 am
- Forum: Tricks 'n' Tips
- Topic: ReverseList
- Replies: 10
- Views: 1477
Re: ReverseList
Thank you, good Idea!
here is a version, that can handle any type of list (structured or not), and is much faster too (SelectElement is quite slow, if the List is very large).
Macro ReverseList(list_)
Define listIndex_ = ListSize(list_) - 1
If listIndex_ > 0
Define *relativeElement ...
here is a version, that can handle any type of list (structured or not), and is much faster too (SelectElement is quite slow, if the List is very large).
Macro ReverseList(list_)
Define listIndex_ = ListSize(list_) - 1
If listIndex_ > 0
Define *relativeElement ...
- Thu Nov 14, 2024 1:41 pm
- Forum: Tricks 'n' Tips
- Topic: Old Skool Effects & Other Stuff
- Replies: 86
- Views: 14479
Re: Old Skool Effects & Other Stuff
exactly my thoughts toomoulder61 wrote: Thu Nov 14, 2024 1:27 pm I just thought it looked like some gears were taller than others?

- Thu Nov 14, 2024 12:14 pm
- Forum: Tricks 'n' Tips
- Topic: Old Skool Effects & Other Stuff
- Replies: 86
- Views: 14479
Re: Old Skool Effects & Other Stuff
Thanks a lot for this collection of beautiful graphics effects! I really enjoyed all of them!
The rotating gears are one of my favorites, so I decided to give it a personal touch...
EnableExplicit
InitSprite()
Enumeration
#MainWindow
EndEnumeration
#GEAR_TEETH_SCALE = 6 ; Scale factor for ...
The rotating gears are one of my favorites, so I decided to give it a personal touch...
EnableExplicit
InitSprite()
Enumeration
#MainWindow
EndEnumeration
#GEAR_TEETH_SCALE = 6 ; Scale factor for ...
- Sat Nov 02, 2024 9:26 pm
- Forum: Tricks 'n' Tips
- Topic: Old Skool Effects & Other Stuff
- Replies: 86
- Views: 14479
Re: Old Skool Effects & Other Stuff
Very nice, I like this kind of stuff (please more of it
)

- Tue Oct 08, 2024 9:26 pm
- Forum: Coding Questions
- Topic: ValHex() got broken -- Curious why
- Replies: 11
- Views: 1605
Re: ValHex() got broken -- Curious why
try it this way
Procedure.q ValHex(n.s)
*t.Character = @n.s
Result.q = 0
While *t\c <> 0
If *t\c >= '0' And *t\c <= '9'
Result = (Result << 4) + (*t\c - 48)
ElseIf *t\c >= 'A' And *t\c <= 'F'
Result = (Result << 4) + (*t\c - 55)
ElseIf *t\c >= 'a' And *t\c <= 'f'
Result = (Result ...
Procedure.q ValHex(n.s)
*t.Character = @n.s
Result.q = 0
While *t\c <> 0
If *t\c >= '0' And *t\c <= '9'
Result = (Result << 4) + (*t\c - 48)
ElseIf *t\c >= 'A' And *t\c <= 'F'
Result = (Result << 4) + (*t\c - 55)
ElseIf *t\c >= 'a' And *t\c <= 'f'
Result = (Result ...
- Mon Aug 26, 2024 6:02 am
- Forum: Coding Questions
- Topic: Read pixels from another program.
- Replies: 13
- Views: 2637
Re: Read pixels from another program.
the coordinates used in GetPixel_ are relative to the window (client area) rather than the entire screen. The origin (0, 0) in window coordinates is usually the top-left corner of the window's client area.
Therefore I use ScreenToClient_ to convert the screen coordinates (DesktopMouseX ...
Therefore I use ScreenToClient_ to convert the screen coordinates (DesktopMouseX ...
- Sun Aug 25, 2024 10:34 pm
- Forum: Coding Questions
- Topic: Read pixels from another program.
- Replies: 13
- Views: 2637
Re: Read pixels from another program.
I was just about to post a similar approach as BarryG.
Scanning 9 Pixels takes around 5 ms on my outdated Laptop...
(Activate the DPI-Aware switch)
Define hwnd, hdc, pt.Point,p1.Point, rc.RECT, x, y
Define wid = 3, hig = 3,size = 50
Dim color(wid,hig)
OpenWindow(0,0,0,wid*size,hig*size,"", #PB ...
Scanning 9 Pixels takes around 5 ms on my outdated Laptop...
(Activate the DPI-Aware switch)
Define hwnd, hdc, pt.Point,p1.Point, rc.RECT, x, y
Define wid = 3, hig = 3,size = 50
Dim color(wid,hig)
OpenWindow(0,0,0,wid*size,hig*size,"", #PB ...
- Wed Aug 21, 2024 7:48 pm
- Forum: General Discussion
- Topic: [solved] text fading
- Replies: 1
- Views: 1005
Re: text fading
have you tried it like that?
OpenWindow(0,0,0,800,200,"!")
EditorGadget(0,0,0,800,200)
LoadFont(0, "Arial", 64)
SetGadgetFont(0,FontID(0))
Repeat
t = ElapsedMilliseconds()
c = 128 + Sin(t * 0.001) * 127
SetGadgetColor(0, #PB_Gadget_FrontColor, RGB(c,c,c))
SetGadgetText(0, " Fading Text Demo ...
OpenWindow(0,0,0,800,200,"!")
EditorGadget(0,0,0,800,200)
LoadFont(0, "Arial", 64)
SetGadgetFont(0,FontID(0))
Repeat
t = ElapsedMilliseconds()
c = 128 + Sin(t * 0.001) * 127
SetGadgetColor(0, #PB_Gadget_FrontColor, RGB(c,c,c))
SetGadgetText(0, " Fading Text Demo ...
- Sat Aug 17, 2024 7:57 pm
- Forum: Tricks 'n' Tips
- Topic: Funny circles
- Replies: 7
- Views: 2509
Re: Funny circles
maybe you overcomplicate things a bit :wink:
here is a "slightly" modified version...
InitSprite()
OpenWindow(0, 0, 0, 800,600, "Funny circles 2")
OpenWindowedScreen(WindowID(0),0,0,800,600,0,0,0)
Repeat
mx = WindowMouseX(0)
my = WindowMouseY(0)
ClearScreen(RGB(255,200,0))
StartDrawing ...
here is a "slightly" modified version...
InitSprite()
OpenWindow(0, 0, 0, 800,600, "Funny circles 2")
OpenWindowedScreen(WindowID(0),0,0,800,600,0,0,0)
Repeat
mx = WindowMouseX(0)
my = WindowMouseY(0)
ClearScreen(RGB(255,200,0))
StartDrawing ...
- Sun Aug 11, 2024 11:26 pm
- Forum: Coding Questions
- Topic: zip/unzip code
- Replies: 5
- Views: 1616
Re: zip/unzip code
yes, I have... :wink:
InitSprite():OpenWindow(0,0,0,800,570,"Zip/Unzip - move mouse",#PB_Window_ScreenCentered|#PB_Window_SystemMenu):OpenWindowedScreen(WindowID(0),0,0,800,600):LoadFont(0,"Arial",100,#PB_Font_Bold)
CreateSprite(0,30,300):StartDrawing(SpriteOutput(0))
Box(0,0,30,280,RGB(64,80,200 ...
InitSprite():OpenWindow(0,0,0,800,570,"Zip/Unzip - move mouse",#PB_Window_ScreenCentered|#PB_Window_SystemMenu):OpenWindowedScreen(WindowID(0),0,0,800,600):LoadFont(0,"Arial",100,#PB_Font_Bold)
CreateSprite(0,30,300):StartDrawing(SpriteOutput(0))
Box(0,0,30,280,RGB(64,80,200 ...
- Thu Jul 25, 2024 7:32 pm
- Forum: Windows
- Topic: FastPixel - a Pixel drawing Library
- Replies: 2
- Views: 6057
FastPixel - a Pixel drawing Library
With this small library (DLL), you can draw a PixelArray. Each value in the array represents an RGBA color. It is not compatible with PureBasic screens, as it creates its own OpenGL rendering context. On my laptop, FastPixel is up to three times faster than PureBasic's internal pixel drawing ...
- Sun Jul 21, 2024 9:12 pm
- Forum: The PureBasic Editor
- Topic: [IDE Tool] Paste as String
- Replies: 2
- Views: 4006
[IDE Tool] Paste as String
Here is a simple tool to insert text from the clipboard formatted as a string into the IDE.
The result looks like this:
"line1" + #CRLF$ +
"line2" + #CRLF$ +
"line3" + #CRLF$ +
...
Procedure PasteAsString()
Protected sci = Val(GetEnvironmentVariable("PB_TOOL_Scintilla"))
If sci = 0 ...
The result looks like this:
"line1" + #CRLF$ +
"line2" + #CRLF$ +
"line3" + #CRLF$ +
...
Procedure PasteAsString()
Protected sci = Val(GetEnvironmentVariable("PB_TOOL_Scintilla"))
If sci = 0 ...
- Thu Jul 18, 2024 12:40 pm
- Forum: Tricks 'n' Tips
- Topic: twisting pillar effect
- Replies: 18
- Views: 5694
Re: twisting pillar effect
How do you even come up with that stuff?
Actually, the idea came to me after reading the previous topic 'Snake simulation'.
In ancient times there was a very active computer demo scene, that came up with the craziest stuff (look for 64k demos or even 4k demos on pouet.net).
One of these effects ...