No transparency in custom backgrounds

Need help with any SMBX game-related issues? Ask your questions here.
Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on-topic/appropriate?
-Are you posting in the right forum/following the forum rules?
Posts: 1
Joined: Sat Aug 18, 2018 5:07 pm
Chat Username: Alancron

No transparency in custom backgrounds

Postby Alancron » Sat Aug 18, 2018 5:52 pm

Hi, i've been dealing with a problem in smbx2's editor: I made a custom graphic in background-23, and it looks fine on the editor, but when i test the level it disappears.



Thanks in advance. :mrgreen:

User avatar
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 6878
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: No transparency in custom backgrounds

Postby Enjl » Sat Aug 18, 2018 6:21 pm

What's actually happening is that only the transparent area in the top left corner is being drawn.
As of Beta 3, BGOs don't automatically resize.
I wrote some code which should take care of that though:

Code: Select all

local replacedBGOs = {1,2,3,4,5,6,7,21,22,27,28,29,31,32,37,94,97,99,101,102,108,109,110,111,112,113,114,117,119,121,122,123,124,131,132,133,147,150,151,152,153}

local bgoImg = {}

for k,v in ipairs(replacedBGOs) do
	bgoImg[v] = Graphics.loadImage("background-"..v..".png")

local cam = Camera.get()[1]

function onDraw()
		local cX = cam.x
		local cY = cam.y
		for k,v in ipairs(BGO.getIntersecting(cX - 200, cY - 100, cX + 1000, cY + 800)) do
			if bgoImg[] then
				Graphics.drawImageToSceneWP(bgoImg[], v.x, v.y, -75)
Put this into a file called lunadll.lua inside your level folder (folder where your custom graphics are). Then all you have to do is change the IDs in the replacedBGOs list. You can take all of them out for a start, I only left them in as an example.

Return to “Help and Support”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest