Changing pixels in Image Data (Island Generation)

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
KingRecycle
Prole
Posts: 44
Joined: Thu May 24, 2012 1:01 am

Changing pixels in Image Data (Island Generation)

Post by KingRecycle » Tue Jun 11, 2013 3:39 pm

I'm trying to generate procedural island and instead of drawing a bunch of FPS destroying rects, I am trying to use image data stuff.

I've never used this so I'm probably using it incorrectly, or maybe my other code is wrong?

I'd appreciate the help in figuring out how to get it to display correctly!

Problem: when it finishes generating the image is just black.
Attachments
ProjectIsland.love
(1.8 KiB) Downloaded 69 times

User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Changing pixels in Image Data (Island Generation)

Post by T-Bone » Tue Jun 11, 2013 5:27 pm

Isn't a Canvas easier and faster? I guess it depends on exactly what you're trying to do. (can't look at your code right now so I really have no idea).

User avatar
KingRecycle
Prole
Posts: 44
Joined: Thu May 24, 2012 1:01 am

Re: Changing pixels in Image Data (Island Generation)

Post by KingRecycle » Tue Jun 11, 2013 5:35 pm

I tried Canvas but I wasn't sure how to use it either. lol

Zeliarden
Party member
Posts: 139
Joined: Tue Feb 28, 2012 4:40 pm

Re: Changing pixels in Image Data (Island Generation)

Post by Zeliarden » Tue Jun 11, 2013 7:23 pm

move

Code: Select all

img = love.graphics.newImage(imgData)
to the end of

Code: Select all

function display()
...
and it will work

User avatar
KingRecycle
Prole
Posts: 44
Joined: Thu May 24, 2012 1:01 am

Re: Changing pixels in Image Data (Island Generation)

Post by KingRecycle » Tue Jun 11, 2013 7:39 pm

Wow, it did work.

I thought I tried that and it didn't work so I moved it back.

Wow...well okay. Thanks a lot.

Post Reply

Who is online

Users browsing this forum: Imagic and 24 guests