Use camera with lowrez graphics template

Hello,

I am trying to use pixel art in my Defold project. After searching through forum posts, I found a render script template here.

I placed a few tiles and followed the directions in the README to get the following result:

no_camera_focus

I am encountering a problem whenever I try to add camera focus. As soon as the messages is posted for the camera to acquire focus, I get this result:

focus

Here is the camera script I am using:

function init(self)
    msg.post("#camera", "acquire_camera_focus")
end

If I set the z-index of the camera go to a high number like 100, I get a blurry version of the first image I presented:

focus_z_100

If I try to move the go the camera is attached to the tiles disappear immediately and I can’t find them again.

Here is the outline for my project for reference:

outline

Here is the console output:

INFO:DLIB: Log server started on port 59860
INFO:ENGINE: Target listening with name: material-defender - fe80::f86f:1cc8:b10a:1b4b - Windows
INFO:ENGINE: Engine service started on port 59861
INFO:ENGINE: Defold Engine 1.3.2 (287c945)
INFO:ENGINE: Loading data from: build/default
INFO:ENGINE: Initialised sound device 'default'
WARNING:RENDER: This interface for render.draw() is deprecated. Please see documentation at https://defold.com/ref/stable/render/#render.draw:predicate-[constants]
INFO:DLIB: SSDP: Started on address 172.21.0.1
INFO:DLIB: SSDP: Started on address 192.168.0.9

I am trying to figure out why I can’t use a camera with this lowrez render script, or if I am perhaps misunderstanding its intended purpose or maybe its out of date (as its from 2018). Thanks in advance.

Have you seen this manual on pixel art graphics: Adapting graphics to different screen sizes

3 Likes

@britzl I have, I was interested in this render script since, at least to me, it appeared to be smoother than what I was able to produce.
That said, if the manual you mentioned is the preferred way to do “8-bit” graphics, I’ll follow the instructions in the manual going forward. Thanks.

I’ve fixed an issue in the render script and I’ve updated the example that comes included with the lowrez template project to include a camera. Please have a look!

1 Like