This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
rahph's profile picture

Pocket computers horizontal.

Started by rahph, 26 March 2015 - 03:15 PM
rahph #1
Posted 26 March 2015 - 04:15 PM
So my idea is to make option of turning pocket computers to horizontal mode and adding event for detecting this. Basically some keyboard shortcut would make pocket computer lay horizontal. After doing it it would fire event. Another shortcut execution would turn it back to normal position. Next problem: Dimensions. They would be recalculated ONLY if program would want this by command like pocket.recDimCurrentPos. recalculate dimensions (to) current position.
It would be useful to games that would be designed to run horizontally. Another fun that would be implemented with this idea: If program does not recalculate and redraw, the screen would appear turned. And last thing: it would work only with pdas with gyroscope. Also, recalculating would also automatically execute:

term.setBackgroundColor(colors.black)
term.setTextColor(colors.white)
term.clear()
EXAMPLE CODE:

while true do
term.setCursorPos(1, 1)
local h = pocket.isHorizontal()
if h == 1 then
term.write("horizontal")
else
term.write("not horizontal")
end
os.pullEvent("rotation_change")
pocket.recDimCurrentPos()
end
SquidDev #2
Posted 26 March 2015 - 04:42 PM
This is been discussed before, though I can't find the link. This was suggested here.

The trouble is that the pocket computer's dimensions are 26 horizontally by 20 vertically so rotating it would actually mean it is thinner when it is horizontal (this is because CC's pixels are 12x18).
Edited on 26 March 2015 - 03:44 PM
Exerro #3
Posted 26 March 2015 - 05:08 PM
Well a change in pixel dimensions would be occuring anyway, so changing them to ~20x26 would also be possible. Something like 35x12 for example.
rahph #4
Posted 26 March 2015 - 06:23 PM
But this would be awesome. Cuz face it- pocket computer is like real life iPad/iPhone etc. So making it ale to turn would be awesome. Also, maybe dan200 should add "texting" And "dialing" And "friends" apps exclusive for PDAs?
HPWebcamAble #5
Posted 27 March 2015 - 01:22 AM
maybe dan200 should add "texting" And "dialing" And "friends" apps exclusive for PDAs?

Or you could, with a program


In response to the original idea:

I've asked about different screen sizes before, this is what dan said:
The size of computer and turtle screens were chosen to make the most of a default-sized minecraft window. The size of pocket computer was chosen because I wanted a portrait aspect ratio. The size of monitors is calculated based on the size of the monitor in blocks, and a default text size I thought looked nice.
(Click the arrow to the left of the heading to see the topic)
Jummit #6
Posted 03 May 2017 - 11:54 AM
It would be so cool if portable computers have a button in the UI or a function in lua which rotates the computer so you can make apps like on real mobiles.