Forum Archive

Scene and ui

polymerchm

What is value in using both? Are their "run" loops the on the same or independent threads?

omz

They have different use cases. scene is mostly for games, ui mostly for app-like GUIs. In some cases, you might need functionality from both – for example, you might use a ui.TextField in a game that allows you to enter your name etc.

polymerchm

Are their interoperability issues?

dgelessus

Interoperability? What's that? ;)

There is the ui.SceneView, which can show a scene inside a UI, with a few minor limitations, but that's basically all you can do. The other way around is practically impossible, except perhaps for popover views on top of a scene.

hbgmysite

no idea lol

dgelessus

@hbgmysite very subtle spam there.

polymerchm

scene.SceneView actually.

ndsizemore

Could someone point to an example of using scene.SceneView? I'd love to be able to add a scene-powered element in an existing ui-based application to be able to display content based on input from ui widgets, but I'm not completely understanding the use of SceneView, especially when trying to add a "custom view" widget in the UI editor. Thanks!

Edit: figured it out, after finding https://omz-forums.appspot.com/pythonista/post/5817214200446976

I'll clean up my code and post the example script and .pyui file soon, in the hopes it will help others.