GDevelop-examples icon indicating copy to clipboard operation
GDevelop-examples copied to clipboard

Device Camera

Open planktonfun opened this issue 2 years ago • 4 comments

Describe the example

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

Checklist

  • [x] I've followed all of the best practices.
  • [x] My game has a proper name in the game properties.
  • [x] My game package name behind with com.example..
  • [x] My game has all events unfolded.
  • [x] I've added myself as the author in the game properties.
  • [x] I've included a file called "README.md" with a description in proper English, explaining what this example is doing.
  • [x] I confirm that this game and all of its resources can be integrated to this GitHub repository, distributed and MIT licensed.
  • [x] I've cleaned unused resources.

Game folder

device-camera-example.zip

planktonfun avatar Jun 25 '22 02:06 planktonfun

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

Bouh avatar Oct 13 '22 21:10 Bouh

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 avatar Oct 14 '22 01:10 planktonfun

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

planktonfun avatar Oct 14 '22 03:10 planktonfun

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.

Bouh avatar Oct 15 '22 21:10 Bouh