Sorry for my english.
2 days ago, downloaded and installed - "LOVE".
With graphics ok. but with images is problem. (loaded only white square)
The picture is the same place where "main.lua"
WHAT IS WRONG ?
function love.load()
image = love.graphics.newImage("test.bmp")
end
function love.draw()
love.graphics.draw(image)
end
Thanks in advance.
I have a question.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: I have a question.
Try making the width and height of the image a multiple of 2.
- Thursdaybloom
- Citizen
- Posts: 81
- Joined: Mon Feb 15, 2010 3:43 am
- Location: Australia
Re: I have a question.
Try this
You need to state where on the X and Y axis the image is going to be placed. In the above example it will be at 50 pixels in along the X axis and 100 pixels down the Y axis.
This will draw the image at the top left-hand corner of the screen
If that doesn't work can you let us know what the dimensions of the image are? In most cases images need to be of dimensions that conform to the power of 2. Examples of this are 32x32, 64x64, 128x128, 256x256 and so on. You can probably guess the rest of them.
I suggest making a 256x256 test.bmp and trying that
Code: Select all
love.graphics.draw(image, 50, 100)
Code: Select all
love.graphics.draw(image, 0, 0)
If that doesn't work can you let us know what the dimensions of the image are? In most cases images need to be of dimensions that conform to the power of 2. Examples of this are 32x32, 64x64, 128x128, 256x256 and so on. You can probably guess the rest of them.
I suggest making a 256x256 test.bmp and trying that
Re: I have a question.
The problem is here.
Thanks for comments.
OnlyImages that have dimensions that are not a 2^n will display incorrectly as a white rectangle on some graphics chipsets.
This function pads images so they will display correctly.
works without problem.Examples of this are 8x8, 16x16, 32x32, 64x64, 128x128, 256x256 and so on.
Thanks for comments.
Re: I have a question.
Fix.Tesselode wrote:Try making the width and height of the image amultiplepower of 2.
To convert between binary and decimal, you must know your powers of two:Thursdaybloom wrote:Examples of this are 32x32, 64x64, 128x128, 256x256 and so on. You can probably guess the rest of them.
1
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16 384
32 768
65 536
And so on.
Edit: Sorry if that was kind of.. uh.. high horse-ish? But seriously, I memorise numbers easily. I know 39 digits of pi. May have forgotten some, though. I'm rusteh.
Hello, I am not dead.
- Thursdaybloom
- Citizen
- Posts: 81
- Joined: Mon Feb 15, 2010 3:43 am
- Location: Australia
Re: I have a question.
You'll find the pattern used is that each entry is double that of the previous. No memorisation required, just keep doubling. I didn't keep listing examples because I don't assume com_1 is stupid and I'm quite sure he can figure out what I meant.Thursdaybloom wrote:You can probably guess the rest of them.
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: I have a question.
I believe dimensions such as 64x128, 256x16, etc. work too. The requirement is 2^n length sides.Thursdaybloom wrote:Examples of this are 32x32, 64x64, 128x128, 256x256 and so on. You can probably guess the rest of them.
- Thursdaybloom
- Citizen
- Posts: 81
- Joined: Mon Feb 15, 2010 3:43 am
- Location: Australia
Re: I have a question.
It's been a while but I think that failed for some people on my Top-Down City project (ie. only square dimensions wored). I've never suffered from this problem though, so I'm not the most experienced in dealing with it. You're more than likely correct thoughTechnoCat wrote:I believe dimensions such as 64x128, 256x16, etc. work too. The requirement is 2^n length sides.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: I have a question.
It doesn't need to be square, AFAIK.Thursdaybloom wrote:It's been a while but I think that failed for some people on my Top-Down City project (ie. only square dimensions wored). I've never suffered from this problem though, so I'm not the most experienced in dealing with it. You're more than likely correct though
Help us help you: attach a .love.
Re: I have a question.
LEN, MOD, SPLIT - is it possible on "Love2D" ?
If yes then how ?
If yes then how ?
Who is online
Users browsing this forum: No registered users and 6 guests