-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No way to rotate text with LUA engine + draw_text for vertical games? #7475
Comments
* Modernised and cleaned up Lua bindings for input classes. * Exposed the input_sequence_poller class to Lua and updated the autofire and cheat plugins to use it, rather than continuing to pretend it's part of the input manager. * Exposed more of the natural keyboard manager, including the ability to enable/disable individual keyboard and keypad devices like you can from the keyboard mode menu. * Exposed a few more things on ioport_port and input_device. -plugins/cheat: Fixed menu item not updating visually when disabling a cheat with UI Left. -plugins/cheatfind: Fixed not finding the first screen after screen enumerator was exposed as an object rather than using a table. -bwidow.cpp, pacman.cpp: Minor cleanup to recent changes.
Would it make sense if these functions drew on the ui layer instead of the "screen"? Then presumably the rotation becomes a non issue. |
Allowing Lua to draw to the UI container is not as simple as you might hope. |
frontend: Made it so you can press UI On Screen Display to hide the Analog Controls menu and see the response to your inputs without the risk of changing settings, and see more axes at once and scroll them for systems with very large number of axes. Also ensure the axis being configured is visible when the menu is visible, and made the menu behave a bit more like the system input assignments menu (including previous/next group navigation). frontend: Allow Lua to draw to the UI container - this addresses the main complaint in #7475. Note that drawing to the UI container will draw over any UI elements, including menus. Plugins can check menu_active to avoid drawing over menus. Also removed some unnecessary use of sol::overload. frontend: Improved info/image box navigation on the system/softwre selection menus, and cleaned up some leftover code that came from the copy/pasted event handling functions. frontend: Fixed sliders menu not handling Alt+Shift as intended (thanks Coverity). Fixed a couple of harmless Coverity errors, too. emu/inpttype.ipp: Made the default assignment for Save State recognise right shift. plugins: Added next/previous group navigation to input macro edit menu. docs: Added basic description of the system and software selection menus, and corrected a couple of errors in the Lua reference.
@h0tw1r3 this has been at least partially addressed by 8ab63e2. It’s now possible to draw to render containers directly (see Lua reference for render container). This allows you to draw text “right way up” when the emulated screen is rotated. Note that render container coordinates are normalised (0,0)-(1,1) for the window/screen area, which may not correspond directly to the screen area due to aspect ratio differences or layouts. There’s still no way to explicitly draw rotated text. Here’s a quick and dirty example that works at the console: ui_ctnr = manager.machine.render.ui_container
lineheight = manager.ui.line_height
function overlay()
ui_ctnr:draw_text('center', 1 - (2 * lineheight), 'hello\nfrom Lua', 0xffffffff, 0x66666666)
end
emu.register_frame_done(overlay, "frame") Using this with Super-X ( Note that anything from Lua drawn to the UI container will draw over UI elements, including menus. You can check |
Confirmed. Works as described. For others reading this, the UI is not included in a :snapshot or :video_recording (which my use case requires). |
See screenshot:
https://i.imgur.com/69IIczu.png
The draw_text API doesn't seem to have any support for rotating the text.
Tested with rom bbakraidja
The text was updated successfully, but these errors were encountered: