Godot: Viewport in Godot 3 - degradation of functionality

Created on 11 Dec 2017  路  16Comments  路  Source: godotengine/godot

OS All, Godot version 3 beta:

That would not be repeated:
https://godotengine.org/qa/21106/porting-project-godot-broke-switching-resolution-viewport

Since nobody suggested a solution to the problem, assuming that the degradation of functionality.

archived bug rendering

Most helpful comment

Looks like the code was commented out when making the new renderer. That's a bug for me: either they should be re-implemented or removed if the function went to somewhere else.

All 16 comments

Have you tried set_size_override ?

Sorry for not having replied a lot of time.

I tested this method. It's not working.

Do a clean demo would be difficult. I have a small program - editor text content. I will soon clean it working part - only leave the settings screen and post it here. Probably this is the easiest way to show what's not working.

maybe because those methods are not implemented yet?

https://github.com/godotengine/godot/blob/master/scene/main/viewport.cpp#L214-L320

Looks like the code was commented out when making the new renderer. That's a bug for me: either they should be re-implemented or removed if the function went to somewhere else.

I need the functionality of a method "get_viewport().set_rect(Rect2)", it or its equivalent.

Here's a demo:

Test.zip

I haven't finished porting the 3.0 Godot, it looks bad. But it shows how it now works. There still are national characters, otherwise it is difficult to alter in the demo. I removed all extra code - as there is only the demonstration of the problem.

  1. To run the program
  2. Click "Settings"
  3. To expand the list (why in Godot 3 he takes place at the top of the screen?)
  4. To switch the resolution
  5. To contemplate how it all shifted

For example, in Godot 2.1 it worked like this:

PB.zip

I know, this error is a milestone 3.0. But in the news a lot is said about the transfer of some errors on 3.1. I really depend on this bug. I'm doing a porting project to Godot 3.0. But to complete this process when this bug will be fixed.

Please do not inflict it on 3.1.

you guys have Viewport.set_size(), which replaced set_rect(), since the position makes not much sense.

using SceneTree.set_screen_stretch is probably better, since you have a lot more options to control stretching and it does all automatically

well, closing since it should not be an issue.

@reduz but is set_size working? It calls _update_rect() which is commented out https://github.com/godotengine/godot/blob/master/scene/main/viewport.cpp#L214-L320

@vnen that function should be gone, as it no longer makes sense. Seems I forgot it there

set_size just saves the size and calls:

VS::get_singleton()->viewport_set_size(viewport, size.width, size.height);

which is enough

Viewports in Godot 3.0 have been simplified a lot, they are either the main viewport or a render target, so just a size argument should be enough.

For the reference, I just removed the obsolete code in 598724c04.

Wait... I don't understand that fully replaced the method "set_rect"? How can I solve the taskwhich was solved by "set_rect"?

Was this page helpful?
0 / 5 - 0 ratings