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?
Alancron
Goomba
Goomba
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.

Image

Image

Thanks in advance. :mrgreen:

User avatar
Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 6556
Joined: Mon Jan 20, 2014 12:58 pm
Flair: -chan ^^

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")
end

local cam = Camera.get()[1]

function onDraw()
	do
		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[v.id] then
				Graphics.drawImageToSceneWP(bgoImg[v.id], v.x, v.y, -75)
			end
		end
	end
end
https://hastebin.com/iboyuzubik.bash
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.
ImageImageImageImage
ImageImageImageImageImageImage
Muh favourite quotes:
Spoiler: show
TheKingOfBoos: enji I'm only scared of you cuz you're always right, and that's creepy
SnoruntPyro: if you don't like kirby you have no life
ToonQuill: do you have any hentai girl sfx
Pichu: "And Jesus said unto his apostles, 'ew so much clash 0/10'."
MNIE52: ohoho master king sitting in his golden chair! Dude, you think you're president? i will not leave, if i want - i'll leave.
MNIE52: i will not kill you, why you so rude. are you have nothing to do, boy?
Sanct: oh my god i made the perfect amount of stairs i am jesus christ.
Spoiler: show
Image


Return to “Help and Support”

Who is online

Users browsing this forum: No registered users and 6 guests