Jump to content




Expanding the screen

game

6 replies to this topic

#1 pofferman

  • Members
  • 36 posts

Posted 07 February 2019 - 02:42 PM

I'm playing around with Computercraft, and so far I have created a player "Box", that moves around the screen.
I have also made a camera, so that i can shift the player, without changing the player position.
I noticed, that you can't go under (1;1) with term.setCursorPos(), is there a hack to bypass this?

I'm using a window as the camera module, and I'm using the window.reposition() function.

The reason, why I am able to go beyond the native max resolution is, that i have specified the window with these paramaters:

local renderWindow = window.create(term.current(), -xT*2, -yT*2, xT*2, yT*2, false)


https://youtu.be/GY5KgvdRYMc

Edited by pofferman, 07 February 2019 - 02:45 PM.


#2 Lupus590

  • Members
  • 1,940 posts
  • LocationUK

Posted 07 February 2019 - 05:16 PM

Make your own window like object which allows for drawing out of bounds. You may want to look at the source code of the window API.

#3 pofferman

  • Members
  • 36 posts

Posted 07 February 2019 - 07:15 PM

So it's not possible with the native term API, with a bit of hacking?

#4 KingofGamesYami

  • Members
  • 2,997 posts
  • LocationUnited States of America

Posted 07 February 2019 - 08:27 PM

You *can* set the cursor position offscreen. It just won't display anything you draw offscreen. Easy test:

term.setCursorPos(-1,1)
term.write("Hello, World")


#5 pofferman

  • Members
  • 36 posts

Posted 07 February 2019 - 08:35 PM

And that is the whole point. To be able to go below the minimum coordinates of 1,1.
I'll have to figure something out then :/

#6 KingofGamesYami

  • Members
  • 2,997 posts
  • LocationUnited States of America

Posted 08 February 2019 - 12:18 AM

Why?

What value is there to shifting the arbitrarily defined values for minimum and maximum coordinates?

#7 pofferman

  • Members
  • 36 posts

Posted Today, 02:55 PM

It would make creating a coordinate system much easier.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users