Skip to content
This repository was archived by the owner on Sep 25, 2020. It is now read-only.
This repository was archived by the owner on Sep 25, 2020. It is now read-only.

Issue with event.touch returning values 2x greater than screen resolution  #43

@ghost

Description

Hello, OCEmu dev's thanks for this program. I explain the issue below.

event = require "event"
component = require "component"
gpu = component.gpu
screen = component.screen

screen.setPrecise(false)
print(gpu.getResolution())
print(screen.isPrecise())

while true do
  _, _, x, y = event.pull("touch")
  print("click at " .. x ..","..y)
end

The above code gives the gpu resolution to be 80, 25 yet when I click in the bottom right corner of the screen the following is printed "click at 160, 50" even after using screen.setPrecise(false). Changing it to screen.setPrecise(true) has no effect on the x, y values returned by event.pull("touch"). I've clicked on the bottom and top of the same 'pixel' and got +1 the value of the top of the pixel, which must mean that OCEmu constantly works as if screen's precise mode is on.

P.S. How can I change the max resolution of the emulator screen. I'd wish to be able to increase it to 160, 50 like a tier 3 screen. Especially since the emulator screen seems to have 'precise' touch event built in which is only a feature of the tier 3 screen.

Hope you can help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions