Why is setColor glitching my image?

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
thecodingotaku
Prole
Posts: 2
Joined: Sat Aug 25, 2012 8:13 pm
Location: USA
Contact:

Why is setColor glitching my image?

Post by thecodingotaku »

I feel stupid for asking such a simple question, but I'm just really banging my head on this one. Basically what I'm trying to achieve is to draw a blue rectangle background in one color, and then switch back to the default color (which I belive is 255,255,255,255, correct?), to draw my other graphics (in this case a logo), except things are glitiching out.

The portion of my code where (I believe) this is happening is as follows:

Code: Select all

local logo = graphics.newImage 'img/logo.png'

function Titlescreen()
  return {
    draw = function()
      graphics.setColor { 100, 200, 255, 255 }
      graphics.rectangle('fill', 0, 0, the.canvas:getWidth(), the.canvas:getHeight()) 
      
      graphics.setColor(255, 255, 255, 255)
      graphics.draw(logo, 100, 30, 0, 0.3, 0.3)
    end,

    --[[ More codez here... ]]
  }
end
I attached a screenshot. As you can see, the logo is drawn as a pure white rectangle, rather than the logo itself (note that it has a transparent background.)

This is not the firs time setColor has messed me up :ehem:. Could someone explain why this is going on? Thanks!
Attachments
Capture.PNG
Capture.PNG (37.59 KiB) Viewed 1103 times
I got nothing...*shrugs*
User avatar
slime
Solid Snayke
Posts: 3170
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Why is setColor glitching my image?

Post by slime »

How big is the logo image? Many cheap integrated video cards (or very old ones) can't handle images with dimensions greater than 2048x2048.
User avatar
Jasoco
Inner party member
Posts: 3727
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Why is setColor glitching my image?

Post by Jasoco »

Yeah, it's probably too big for your graphics card. Large images should always be broken up.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 3 guests