setcursorposition in console window

BlitzMax Forums/BlitzMax Beginners Area/setcursorposition in console window

Panno(Posted 2008) [#1]
is this possible ?
chr$(8) will not work


Gabriel(Posted 2008) [#2]
This any good to you?

http://www.blitzbasic.com/Community/posts.php?topic=49549


Panno(Posted 2008) [#3]
no sorry


plash(Posted 2008) [#4]
What is Chr(8) supposed to do? (I've never seen that character code used for anything)


Sledge(Posted 2008) [#5]
http://www.blitzbasic.com/Community/posts.php?topic=67845


Panno(Posted 2008) [#6]
this is only os : win :(


GW(Posted 2008) [#7]
If you want cross platform then curses is the only option I think for a real console window.
I created a roguelike in Bmax and ended up writing my own console lib to use the Bmax window with terminal image font.


Brucey(Posted 2008) [#8]
I have a 50% developed cross-platform curses module. Runs in a console and works on Mac, Win32 and Linux. Still needs quite a bit of the API implemented tho, but works quite well. No public release available yet.

Been having a look at libtcod over the last day or so. Looks doable although the SDL backend needs re-implemented in BlitzMax. I have the code currently compiling on Win32 and Mac. Done properly (haw), this could work under GL and DX.


GW(Posted 2008) [#9]
That's great that your converting Libtcod Brucey, put me on the beta testers list.


Brucey(Posted 2008) [#10]
...not the most exciting screenshot in the world...


getting a BlitzMax backend working instead of the SDL one is a bit more work than I thought... but not impossible, it seems :-p

Currently trying to figure out the best way to build the non-root consoles. perhaps render-to-texture... or straight into a pixmap... ack!


GW(Posted 2008) [#11]
The first method I started with was to create an Type called 'tScreen' that contains an [8*8 pix] array the size of the window:
[psuedo example]
Type tCell
  Field Char$ = chr(0)
  Field fColor%[3]
  Field bColor%[3]
EndType

Type tScreen
  Field Cells[ScreenW,ScreenH]:tCell   '// ScreenW is GraphicsWidth/8 for 8x8 image

  Method Print(String$, X,Y,fCol%[],bCol%[])
     '// loop through the string, set each cell to its char/color
  EndMethod
End Type

Then have one global variable that contains the current screen being shown
so the user can create custom screens and show/hide them as needed.

Also here are some good terminal fonts.
http://dwarf.lendemaindeveille.com/index.php/List_of_user_character_sets


Panno(Posted 2008) [#12]
rox :)