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:
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