Hi, im trying to draw this image:
Note: the text at the second image is my title screen text
EDIT: Thank you for everything! This love2d community is really helpful for a love2d-beginner like me.
But when I draw it using the love.graphics.draw function, it shows this:
I tried applying (255,255,255,255) as the love.graphics.setColor() before drawing the image, but still that happensImage not Displaying Right
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- yetneverdone
- Party member
- Posts: 446
- Joined: Sat Sep 24, 2016 11:20 am
- Contact:
Image not Displaying Right
Last edited by yetneverdone on Thu Oct 06, 2016 2:29 am, edited 4 times in total.
My GameDev Website
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Re: Image not Displaying Right
If you don't provide the code snippet you have now, it will be difficult to help
- zorg
- Party member
- Posts: 3449
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Image not Displaying Right
Off the top of my head, löve doesn't support gif files... out of the box, i mean; there's at least one gif loader library that handles them.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
- yetneverdone
- Party member
- Posts: 446
- Joined: Sat Sep 24, 2016 11:20 am
- Contact:
Re: Image not Displaying Right
It's not a .gif filezorg wrote:Off the top of my head, löve doesn't support gif files... out of the box, i mean; there's at least one gif loader library that handles them.
My GameDev Website
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
- yetneverdone
- Party member
- Posts: 446
- Joined: Sat Sep 24, 2016 11:20 am
- Contact:
Re: Image not Displaying Right
Okay, here is the code for the whole class I made:sherpal wrote:If you don't provide the code snippet you have now, it will be difficult to help
I used the classic OOP library
Code: Select all
local Anim = Object:extend()
function Anim:new(path,name,fw,fh,iw,ih)
self.path = path
self.name = name
self.fw = fw
self.fh = fh
self.iw = iw
self.ih = ih
self.rowFrames = self.iw / self.fw
self.colFrames = self.ih / self.fh
self.totalFrames = self.rowFrames * self.colFrames
self.image = love.graphics.newImage(self.path)
self.animationFrames = {}
--total number per frames
for i = 1, self.totalFrames do
--make per rows
for row = 1, self.rowFrames do
--make per columns
for col = 1, self.colFrames do
--x
for x = 1, self.iw, self.fw do
--y
for y = 1, self.ih, self.fh do
i = love.graphics.newQuad(x,y,self.fw,self.fh,self.image:getWidth(),self.image:getHeight())
end
end
end
end
table.insert(self.animationFrames,i)
end
end
function Anim:update(dt)
end
function Anim:draw()
love.graphics.setColor(255,255,255,255)
for i = 1, #self.animationFrames do
love.graphics.draw(self.image,self.animationFrames[i],i*,0,0,0.5,0.5)
end
end
return Anim
My GameDev Website
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
- yetneverdone
- Party member
- Posts: 446
- Joined: Sat Sep 24, 2016 11:20 am
- Contact:
Re: Image not Displaying Right
Oh, another thing is, even i tried to display it the normal way, like
Displays the samefunction love.load()
image = love.graphics.newImage("assets/image.png")
end
function love.draw()
love.graphics.setColor(255,255,255,255)
love.graphics.draw(image,0,0)
end
My GameDev Website
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
- zorg
- Party member
- Posts: 3449
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Image not Displaying Right
I'm sorry, i just assumed it was, given what you said in the first post:yetneverdone wrote:It's not a .gif filezorg wrote:Off the top of my head, löve doesn't support gif files... out of the box, i mean; there's at least one gif loader library that handles them.
Also, the other image was so vastly different than the first, without code, i don't think we could have helped.yetneverdone wrote:Hi, im trying to draw this image:
[title screen.gif]
A love file could be helpful.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
- yetneverdone
- Party member
- Posts: 446
- Joined: Sat Sep 24, 2016 11:20 am
- Contact:
Re: Image not Displaying Right
Sorry about that.zorg wrote:I'm sorry, i just assumed it was, given what you said in the first post:yetneverdone wrote:It's not a .gif filezorg wrote:Off the top of my head, löve doesn't support gif files... out of the box, i mean; there's at least one gif loader library that handles them.Also, the other image was so vastly different than the first, without code, i don't think we could have helped.yetneverdone wrote:Hi, im trying to draw this image:
[title screen.gif]
A love file could be helpful.
Well it would be my whole project haha is it okay?
My GameDev Website
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Re: Image not Displaying Right
Maybe you're setting something else before calling love.graphics.draw? Like a stencil, a blend mode, a shader...?
If not, then yes, attaching a .love file to your post should help. Preferably a trimmed down version that still exhibits the problem, but it's OK if it's the whole project.
If not, then yes, attaching a .love file to your post should help. Preferably a trimmed down version that still exhibits the problem, but it's OK if it's the whole project.
- yetneverdone
- Party member
- Posts: 446
- Joined: Sat Sep 24, 2016 11:20 am
- Contact:
Re: Image not Displaying Right
There is no shader, stencil, or blend mode. Okay I will attach itpgimeno wrote:Maybe you're setting something else before calling love.graphics.draw? Like a stencil, a blend mode, a shader...?
If not, then yes, attaching a .love file to your post should help. Preferably a trimmed down version that still exhibits the problem, but it's OK if it's the whole project.
My GameDev Website
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Who is online
Users browsing this forum: Bing [Bot] and 5 guests