Page 1 of 2

Some questions before purchase (graphic wise)

Posted: Tue Sep 19, 2023 10:06 pm
by Attronach
Hello,

Past time I work with GFABasic and PowerBasic. Later under DJGPP (C) and WatcomC. Created few project (mostly games) under Atari STe, Amiga500/1200 and older PC (with Watcom C under DOS4G extender).

ATM I have Visual Studio installed and trying to find way how to create user-friendly environment to update my old programs for windows10/11.
This is very frustrating work. I'm not happy with how hard is find way to force my C# source code run in SINGLE GRAPHIC window to be able work with bitmap pictures.

My questions abour PureBasic:
1. Can I create one simple graphic application window where I can:
-display more bitmap objects (stored in memory) at any position?
-move these objects over screen w/o destroying whole window content?

Small sample what I need to move over screen (Created with GFABasic):

Image

I mean, how hard is:
1, load images from HDD to memory
2 open single window and place partial images (like subimages mages 1-15) to opened screen
3. slowly move single image (depend on user input) over screen?

Sub question:
In case whole this picture is screen...
Can i draw timer in text mode or I have to create sub-picture and then draw (put) it on screen?
Can I already loaded pictures save to disc (in binary format?


Maybe my questions are stupid :oops: , but I need to be sure I can work with screen like in old days without tons of balast code, events manipulation etc..

I will be really happy if anyone can confirm this is possible with PureBasic.

Thx&
have a nice day

Re: Some questions before purchase (graphic wise)

Posted: Tue Sep 19, 2023 10:12 pm
by BarryG
Yes, you can do that easily. Here's a jigsaw puzzle app that demonstrates:

viewtopic.php?f=27&t=72217

This should work with the demo version of PureBasic because it has no API commands.

Re: Some questions before purchase (graphic wise)

Posted: Tue Sep 19, 2023 11:24 pm
by Kuron
Since for that type of game there are no fast moving images (sprites) you would not need to use OpenGL. You could simply use the Canvas Gadget. The Canvas Gadget is very similar to the Graphic target introduced in PowerBASIC 10.

PureBasic is more than capable of the game style you want, and more advanced 2D games if you want to use OpenGL.

Re: Some questions before purchase (graphic wise)

Posted: Tue Sep 19, 2023 11:28 pm
by boddhi
Hi,
Attronach wrote: I will be really happy if anyone can confirm this is possible with PureBasic.
I agree with BarryG.

In the past, I too developed a few games and utilities on Amiga 500/4000 with BlitzBasic and Amos, then PowerBasic and RealBasic on PC.
Even though I don't really program games any more (I still have an old unfinished blackjack from more than 10 years ago), PureBasic has some very interesting instruction sets (2D and 3D) for that.

Edit : {I agree with BarryG} and Kuron

Re: Some questions before purchase (graphic wise)

Posted: Tue Sep 19, 2023 11:32 pm
by Kuron
boddhi wrote: Tue Sep 19, 2023 11:28 pm and RealBasic on PC.
You have my deepest sympathies.

Re: Some questions before purchase (graphic wise)

Posted: Tue Sep 19, 2023 11:35 pm
by boddhi
Kuron wrote: You have my deepest sympathies.
:D Honestly, I don't regret it at all!!! :mrgreen:

Re: Some questions before purchase (graphic wise)

Posted: Tue Sep 19, 2023 11:37 pm
by Kuron
boddhi wrote: Tue Sep 19, 2023 11:35 pm Honestly, I don't regret it at all!!! :mrgreen:
I only remember it as being bloated beyond belief. Big difference in moving to PB. :mrgreen:

Re: Some questions before purchase (graphic wise)

Posted: Tue Sep 19, 2023 11:46 pm
by boddhi
Kuron wrote: I only remember it as being bloated beyond belief. Big difference in moving to PB. :mrgreen:
The same !

I can't remember which version I stopped at (5 or 6).
At the time, a simple "Print hello" was at least 1.5 MB for barely a few dozen KB for PB. The decision to change was made quickly!

Re: Some questions before purchase (graphic wise)

Posted: Tue Sep 19, 2023 11:55 pm
by AZJIO
Attronach wrote: Tue Sep 19, 2023 10:06 pm -move these objects over screen w/o destroying whole window content?
You can even see how it works.
viewtopic.php?t=76759
another example
viewtopic.php?t=80565
viewtopic.php?t=81423

Re: Some questions before purchase (graphic wise)

Posted: Wed Sep 20, 2023 3:31 pm
by benubi
You would still have to redraw the screen every frame.

If you would like to carry that bitmap without a redraw, maybe with WinAPI if you convert it to a cursor sprite, perhaps with a mouse cursor or hand drawn over it to show the drag/drop action. But you can draw as you wish frame by frame using a screen/windowed screen or go through the CanvasGadget. Using the WindowOuput() for drawing often causes flickering with my tests, and when other windows get dragged over it there are drawing artifacts from the OS, it works but it can have dirty regions for a sec if other windows overlap it.

You can write good looking things with a CanvasGadget and use it's features to capture mouse and keyboard events and Draw the bitmaps. It's slower than displaying sprites in full screen or windowed mode, tho, and you might have to write your own custom drawing filter to display transparent bitmaps - or you use DrawAlphaImage() but this is a bit slow, depending on how much you draw and what "frame rate" you need. I think doing a GUI for your app should work well, tho. In screen mode the used keyboard inkey() functions aren't as responsive or intuitive, they respond only after releasing the key - and there's no stroke repetition; the CanvasGadget responds like a GUI element would, it may be more suitable. Each solution has it's merits and little deficits.

Re: Some questions before purchase (graphic wise)

Posted: Wed Sep 20, 2023 3:31 pm
by Attronach
Thnx all for info and links.

I will check everything.

Re: Some questions before purchase (graphic wise)

Posted: Wed Sep 20, 2023 4:06 pm
by Attronach
benubi wrote: Wed Sep 20, 2023 3:31 pm You would still have to redraw the screen every frame.

depending on how much you draw and what "frame rate" you need. I think doing a GUI for your app should work well, tho. In screen mode the used keyboard inkey() functions aren't as responsive or intuitive, they respond only after releasing the key - and there's no stroke repetition; the CanvasGadget responds like a GUI element would, it may be more suitable. Each solution has it's merits and little deficits.
Screen refresh while window moving or inactive don't bother me. There are less than 10 hotkeys necessary to handle while play both games I have plan to resurrect.
Already download PB demo version and some source files mentioned in this thread.
Over weekend I have time to explore everything :)

Have a nice day

Re: Some questions before purchase (graphic wise)

Posted: Fri Sep 22, 2023 7:26 am
by Attronach
Hello again,

I'm doing something wrong.

Can anyone tell me please, how to display simple text from string on screen?
Something like 'c' do:

Code: Select all

char string_num [7] = "123456";
printf ("%s", string_num);
:cry:

Re: Some questions before purchase (graphic wise)

Posted: Fri Sep 22, 2023 7:47 am
by mk-soft
See PB-Help Console ...

Re: Some questions before purchase (graphic wise)

Posted: Fri Sep 22, 2023 7:50 am
by AZJIO
Attronach wrote: Fri Sep 22, 2023 7:26 am "%s"
sprintf
Format
Str(string_num)