GDevelopApp / GDevelop-examples

Repository of examples and templates for GDevelop - the open-source, no-code game engine
https://gdevelop.io
54 stars 20 forks source link

Device Camera #327

Open planktonfun opened 2 years ago

planktonfun commented 2 years ago

Describe the example

A rough example on how to render video from camera device on gdevelop.

Checklist

Game folder

device-camera-example.zip

Bouh commented 2 years ago

Hello I tryed the example on my pixel5 phone, and the quality is very low.

Do you think there is something to adjust?

Screenshot_20221013-231046

planktonfun commented 2 years ago

Yup you can adjust these parameters in the events, you can increase the quality in exchange of performance

video.style.width = '200px';
video.style.height = '200px';
canvas.height = 200;
canvas.width = 200;
context.drawImage(video,0,0,200,200);

Still looking for a way to port it directly into a video object so it won't work hard as much per frame

planktonfun commented 2 years ago

Hello I tryed the example on my pixel5 phone, and the quality is very low.

Nevermind, found a way to port it, now it can display video at full quality and performance

!update device-camera-example.zip

Also, there are no actions to resize video objects in gdevelop? image

Bouh commented 2 years ago

Also, there are no actions to resize video objects in gdevelop?

This raised a more significant issue in previous discussions. These width/height or scale actions are unique to each object and have to be implemented. So in the future, they should be universal, which doesn't require adding these features for each objects types.