Some questions before purchase (graphic wise)

Everything else that doesn't fall into one of the other PB categories.
Attronach
User
User
Posts: 12
Joined: Tue Sep 19, 2023 9:41 pm

Re: Some questions before purchase (graphic wise)

Post by Attronach »

AZJIO wrote: Fri Sep 22, 2023 7:50 am
Attronach wrote: Fri Sep 22, 2023 7:26 am "%s"
sprintf
Format
Str(string_num)
Sorry no russian.
AZJIO
Addict
Addict
Posts: 2191
Joined: Sun May 14, 2017 1:48 am

Re: Some questions before purchase (graphic wise)

Post by AZJIO »

QTranslate
Crow Translate
s3_translator
examples don't need a translator.
you can read here. But it won't be perfectly accurate.
Attronach
User
User
Posts: 12
Joined: Tue Sep 19, 2023 9:41 pm

Re: Some questions before purchase (graphic wise)

Post by Attronach »

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

Thnx!
infratec
Always Here
Always Here
Posts: 7619
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Some questions before purchase (graphic wise)

Post by infratec »

In PB you have 3 choices:

console programs (only Text)
GUI programs (graphic elements)
Screen programs (sprites)

You have to decide what you want to use.
The later 2 are event driven, you need one event loop for handling the events.
Attronach
User
User
Posts: 12
Joined: Tue Sep 19, 2023 9:41 pm

Re: Some questions before purchase (graphic wise)

Post by Attronach »

infratec wrote: Fri Sep 22, 2023 10:56 am In PB you have 3 choices:

console programs (only Text)
GUI programs (graphic elements)
Screen programs (sprites)

You have to decide what you want to use.
The later 2 are event driven, you need one event loop for handling the events.
It's hard to decide because I don't know what all I can do in every options.

ATM I need to handle long file (contain a lot of text separated by [CRLF] with fixed structure (line1, line2, line3, line4, line5 all this 100+ times) . Display this separated text lines in some kind of 'form". And most important I have to handle local language support. Latter there are some pictures (no animation, just bitmaps).

I think console can handle this but I don't know it's possible enlarge text size + select correct font with language support (fonts like Consolas or Constantia). I prefer not work with graphicalconsole because long lines not prperly formated in window.
I saw some DLL or Library manipulation I can't use because I have only demo PB.

So question is, CAN console handle this or I have to use GUI method? I don't think sprites is correct way.
Bitblazer
Enthusiast
Enthusiast
Posts: 762
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: Some questions before purchase (graphic wise)

Post by Bitblazer »

Attronach wrote: Fri Sep 22, 2023 11:20 am Latter there are some pictures (no animation, just bitmaps).

So question is, CAN console handle this or I have to use GUI method? I don't think sprites is correct way.
It will very much depend on the available console / terminal emulation.

I know 2 ways to display "pictures" on a console without using the graphical console. One method is easy - you convert your pictures to ascii using an online service, embed them into your source (see datasection / includebinary) and then output them to the console.

The advanced method involves redefining the console character charset to a custom font. That method is definately not for beginners and not possible on all consoles.

To answer your question - if using the graphical console or a converted ascii art is good enough for you, then yes it works. Otherwise no ;)
BarryG
Addict
Addict
Posts: 4173
Joined: Thu Apr 18, 2019 8:17 am

Re: Some questions before purchase (graphic wise)

Post by BarryG »

Attronach wrote: Fri Sep 22, 2023 11:20 amCAN console handle this or I have to use GUI method?
Both. In your first post, you showed the well-known "15 Puzzle".

Here's a PureBasic console version of it -> https://www.rosettacode.org/wiki/15_puz ... #PureBasic

Here's a PureBasic windowed version with non-graphical buttons* -> viewtopic.php?f=27&t=76759

And here's how PureBasic can do other sliding puzzle games -> viewtopic.php?t=73417

I hope these three links show you what the paid version of PureBasic can do.

*The buttons can have graphical images on them if you prefer, like in your first post.
Attronach
User
User
Posts: 12
Joined: Tue Sep 19, 2023 9:41 pm

Re: Some questions before purchase (graphic wise)

Post by Attronach »

Bitblazer wrote: Fri Sep 22, 2023 12:42 pm
Attronach wrote: Fri Sep 22, 2023 11:20 am Latter there are some pictures (no animation, just bitmaps).
To answer your question - if using the graphical console or a converted ascii art is good enough for you, then yes it works. Otherwise no ;)
I see. I thing draw image in separate small window will be enough. And picture is bonus not requirement.
Main problems are font size and correct displaying national characters.
Bitblazer
Enthusiast
Enthusiast
Posts: 762
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: Some questions before purchase (graphic wise)

Post by Bitblazer »

Advanced purebasic users could use the windows ncurses port.

Image

But the graphical console can do the same and is a native part of purebasic.
benubi
Enthusiast
Enthusiast
Posts: 220
Joined: Tue Mar 29, 2005 4:01 pm

Re: Some questions before purchase (graphic wise)

Post by benubi »

In Console use Print() and PrintN()

In drawing mode use DrawText()

Code: Select all

OpenConsole()
define String_Num$ = "12345"
PrintN(String_Num$)
define A$
PrintN("Hit RETURN to exit")
A$ = Input()
; 
CloseConsole()
Variable names ending with $ are automatically defined as strings. Without $ you have to put ".s" suffix for the data type. Sometimes it may be necessary to define the string with a struct "wrapping".

Code: Select all

define MyString1.s = "Hello World 1"
Print(MyString1)

define MyString2.STRING\s="Hello World 2"
Print(MyString2\s)
Technically pointers should take the same place in memory BUT with .STRING you can get to the pointer of the string-pointer (where the string pointer is stored).

Define MyString2.STRING
@Mystring2 eq. **tchar
@MyString2\s eq. *tchar

Define MyString1.s
@MyString1 == @Mystring1 ; only *tchar

You may need sometimes the .STRING structure. Notice you can't return structures in PB. You have to return a Pointer, which is equal to the .i or .INTEGER type (size depends or architecture/OS 32 or 64 bit).

Code: Select all


Global MyString1.s, MyString2.STRING, MyString3$

Procedure.i ReturnStructurePointer()
   ProcedureReturn @MyString2
EndProcedure

Procedure$ ReturnString1()
   ProcedureReturn MyString1 ; MyString3$
EndProcedure

Procedure.s ReturnString2()
   ProcedureReturn MyString2\s
EndProcedure
There are also embedded fixed string types, they are normally also 16 bit Unicode sized "TCHAR" type.

Code: Select all

Structure IhaveFixedString
   Username.s{16} ; 16 characters * 2 = 32 bytes
EndStructure


Define User.IHaveFixedString\Username = "Snake P."

Debug User\Username

You may want to access fixed strings or write them in ASCII/UTF8, you will have to use PokeS() and PeekS()

Code: Select all

Structure MyUser
   Username.a[32] ; Username is 32 characters long, be careful to zero unused chars or limit max name length to 31 for string terminator (null char)
EndStructure

define User.myUser
Pokes(@User\Username,"Anonymous",32,#PB_Ascii | #PB_String_NoZero) ; max 32 bytes length will be PokeS-ed

define UserName$
UserName$ = PeekS(@User\Username, 32, #PB_Ascii) ; PeekS the ascii string, max 32 bytes/characters

Debug UserName$
Post Reply