How To

CELL makes transparent pixels have wrong background?

2

evn 2022-06-02 07:09

Hello all, I just discovered LowRes NX and I’m really excited to be able to develop for a fantasy console on my iPhone. Unfortunately I’m having a frustrating issue with the CELL function and I’m hoping someone can help.

I want the transparent pixels of my characters to show the grey background behind. What actually appears behind is character 0 in palette 0.

How can I have the grey character pass through, or at least set a default character, size, and palette?

Thank you :)

PS
I am trying to upload source code but I get a forum error “Screenshot has wrong size. Please create it in the recommended way.” Sadly I do not know what the ‘recommended ways’ is, nor do I see this referenced in the manual or on the forums. Any help would be greatly appreciated


Timo 2022-06-02 08:33

Hi!
Sorry, that should be more obvious in the Gfx Designer, but it's not :/
Usually you have to leave character #0 empty, because it's the default background. There is no way to show NO character in the background, so you always need an empty one.

To make a screenshot on iPhone, just run your program and tap on the three dots button (top right corner) and then "capture program icon". This will be uploaded when sharing from the app.


GAMELEGEND 2022-06-02 11:19

just incase you haven't figured it out yet

the screenshot size has to be 160x128 which is the same size of the Lowres screen


evn 2022-06-02 18:25 (Edited)

Thank you for responding! I have changed characters 0,1,16, and 17 to be what I want the background to be like with palette 7. However, only character 0 in palette 0 is shown ‘behind’ the number tiles. Can someone help me understand how to achieve my desired effect? Thanks!


was8bit 2022-06-03 06:41

Here is your fixed program :)

Minesweeper Fixed.nx | Open in app
2022-06-03 06:41

was8bit 2022-06-03 06:50

The problem is with CELL SIZE ... the default size is 0 or single cell...

"Blank" in mode 0, single cell mode, is 20x16 grid of cell #0

"Blank" in mode 1, 2x2 cell mode, is 10x8 grid of 2x2 blocks whose upper left corner is #0... so each grid gets cells#...
0,1
16,17

It's tricky when mixing one BG with size 0 and another BG with size 1....

One thing you CAN'T do on a BG size 1 is use PRINT or NUMBER commands... remember, with CELL SIZE set to 1 you only use the upper left corner of the 2x2 block in your code, but all 4 cells in the 2x2 block will be shown, rendering PRINT and NUMBER useless on such a BG

So, if you need to show your score, all your big 2x2 images will need to stay on BG 1, and all your scores and text stay on BG 0, with BG 0 left as default setting, and BG 1 set in 2x2 block mode with CELL SIZE 1,1


was8bit 2022-06-03 06:58 (Edited)

Also, IF you are designing a background layout using the background editor, the default is single cell...

But IF you want your background to go onto a layer that is set with CELL SIZE to 1 (2x2 big blocks) then before you start your background, first set it's size to 10x8 16x16 (pixels)...

Also, when editing a background set up for the 2x2 big blocks, when selecting characters to add to your background, do NOT highlight all 4 cells of your 2x2 block... only highlight it's upper left corner...


was8bit 2022-06-03 07:05 (Edited)

When making games with TOUCH for cell phones, a 2x2 square is the smallest size that will be playble for cell phones, so you will need to get comfortable with using CELL SIZE often...

Also remember that SPRITES are more flexible... letting your have 1x, or 2x2, or 3x3, or even 4x4 sized sprites.... it is possible to make a tile based game with just sprites, just remember sprites are limited to 0- 63, so an 80 tile game couldn't be done all in sprites....


nathanielbabiak 2022-06-05 02:43 (Edited)

You wrote "how can I have the grey character pass through, or at least set a default character, size, and palette?" Two things to keep in mind before seeing the code snippet:

  1. Keep character #0 empty for a clean background.
  2. Note that BG 1 is layered behind BG 0.

Check out the manual for explanations for these commands, and let us know if you have questions.

'SET DEFAULT CHARACTER, SIZE, AND PALETTE (ON BG 1).
MY_SIZE = 1
MY_CHAR = 1
MY_PAL  = 3
CELL SIZE 1, MY_SIZE
PAL MY_PAL
BG 1
BG FILL 0,0 TO 31,31 CHAR MY_CHAR

'ALLOW CELL AND TEXT COMMANDS (ON BG 0).
BG 0

'YOUR CODE CONTINUES HERE...


evn 2022-06-11 15:46

Thank you all for your help! I’m looking at all your suggestions and making progress on my project


was8bit 2022-06-11 16:24

:)


Log in to reply.