ascii graphics

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Ghost301
Newbie
Posts: 4
Joined: Mon Jan 30, 2006 6:17 pm
Contact:

ascii graphics

Post by Ghost301 » Mon Jan 30, 2006 6:27 pm

is it possible to add graphics into an ascii game if so how

User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} » Mon Jan 30, 2006 9:28 pm

Your answers can be answered very well (but sometimes rather slowly) at www.pure-text.com. Come on, join! We need some... err... life...
Image

Ghost301
Newbie
Posts: 4
Joined: Mon Jan 30, 2006 6:17 pm
Contact:

Post by Ghost301 » Thu Feb 02, 2006 8:12 pm

:? maybe i'm looking in the wrong places but I can't find a register area and there are a few broken links

User avatar
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 » Thu Feb 02, 2006 9:03 pm

What type of graphics do you want? e.g. Regular pixel graphics? or how to use the text to give you graphic style outputs, like ASCII images etc.. ?
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)

Ghost301
Newbie
Posts: 4
Joined: Mon Jan 30, 2006 6:17 pm
Contact:

Post by Ghost301 » Thu Feb 02, 2006 10:21 pm

i'm a newb but i'm prettty sure i'm looking for pixel graphics
corredt me if i'm wrong but when you say text graphics you mean ASCII charcter codes right? cause i know those

Antoni
Veteran
Posts: 132
Joined: Wed Jun 15, 2005 3:01 pm
Contact:

Post by Antoni » Fri Feb 03, 2006 10:34 am

In a true Text Mode (SCREEN0) you can't have pixel graphics as textmodes does'nt allow adressing individual pixels at all. So you need to build graphics from the available characters. There are editors for them, check for the newest as Rattrapmax's, as the older ones encode its output for an ANSI terminal (and would require you to program a decoder).

You can too set a graphics mode as SCREEN 12, that will allow you to output text and pixel graphics at the same time.

Code: Select all

screen 12
defsng a-z 
view print 20 to 27
line (0,0)-(639,300),1,BF
line (100,50)-(540,200),0,BF
do
 r% = (r% + 1) AND 15
 FOR y% = 1 TO 99
   y1% = ((1190 \ y% + r%) AND 15)
   y2 = 6 / y%
   FOR x% = 100 TO 540
    PSET (x%, y% + 100), CINT((319 - x%) * y2) AND 15 XOR y1% 
  NEXT x%,y%
 f%=(f%+1)mod 5: if F%=0 then color int(rnd*16): print "blah"
loop until len(inkey$)

Ghost301
Newbie
Posts: 4
Joined: Mon Jan 30, 2006 6:17 pm
Contact:

Post by Ghost301 » Fri Feb 03, 2006 6:21 pm

sweet !!!
i'm pretty good with ascii games I just wanted some graphics
thanks a lot :D

User avatar
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 » Sat Feb 04, 2006 3:42 pm

Antoni wrote:There are editors for them, check for the newest as Rattrapmax's,
That was made in FreeBasic,. the normal output won't work in QBasic since it's 32bit colour..

Tho, it is a nice example:
http://members.aol.com/rattrapmax6/myproggies/APPL1.zip
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)

Antoni
Veteran
Posts: 132
Joined: Wed Jun 15, 2005 3:01 pm
Contact:

Post by Antoni » Sun Feb 05, 2006 11:49 am

Btw: A texmode demos place http://taat.fi/tmdc/

Post Reply