RenderCam HTML 5 fullscreen issues (SOLVED)

Has anyone successfully used RenderCam for fixed aspect ratio HTML5 games in full screen mode?

I keep running into issues where it crops the game. Doesn’t do it in the Defold debugger, does do it in a Windows .exe build or HTML 5 build.

Happy to pull code apart, just wanted to see if someone had this working somewhere before I invested the time.

Live example here: http://functionallyimmortal.com/Game/index.html
(At least till I change it)

Put it in full screen mode with a odd aspect ratio, a phone in portrait orientation should do the trick.

Best example is probably this:
vertissuesmall

RenderCam settings:

go.property("active", true)
go.property("orthographic", true)
go.property("nearZ", -1)
go.property("farZ", 1)
go.property("viewDistance", 0)
go.property("fov", -1)
go.property("orthoScale", 1)

go.property("fixedAspectRatio", true)
-- Using a vector property to set aspectRatio so it can be more accurate.
-- This way you don't end up with 800 x 599.9994812093 px view areas.
go.property("aspectRatio", vmath.vector3(5, 3, 0)) -- only used with a fixed aspect ratio

go.property("useViewArea", false)
go.property("viewArea", vmath.vector3(1280, 768, 0))

go.property("expandView", false)
go.property("fixedArea", true)
go.property("fixedWidth", false)
go.property("fixedHeight", false)

Hmm, that is strange. If you don’t mind sending me the project files, I can take a look.

It looks like you are editing the camera script file directly though? It’s not intended to be used that way at all. All of the camera settings are script properties, so you can change them on each instance in the editor. If you mess with the code, obviously I can’t guarantee that anything will work. Also, if you’re using it as a library dependency, any changes you make will be cleared when you fetch libraries (and on editor restart I think?).

3 Likes

I am using it as a library, yes. I pulled the script into the main project so I could save the changes but didn’t consider the ramifications of doing so.

Ill restore it and change them in the editor and see if that resolves, if not Ill send you project.

Thanks for the help.

Well, if you only changed the values of the script properties in the file, then it’s not too likely that something broke. I would guess that either you don’t have the properties set quite right on your camera, or there is something about HTML5 fullscreen that rendercam doesn’t deal with properly. (Oh, hmm, but you said it also fails with a windows bundle, so that’s not it…)

2 Likes

Pointing the camera back to the script in the library and then using the IDE to change the values solved the problem (I updated the link).

May have something to do with how the LUA and Defold scoping interact?

My goal for this project is to let the little things go, so have been stepping on my urge to work out exactly how things work pretty hard, lest I never finish. Which means I am going to resist the urge to look into exactly why this did what it did.

In saying that I am happy to pull the version of source that had the issue and send it to you if you are curious enough to poke around.

Regardless, thanks for the help. Oh and for also supplying the code so that I don’t have to do all the aspect work myself.

crisp high five

2 Likes