Posted: 22nd Aug 2011 18:34
I thought the AGK_KEY_RIGHT was some sort of constant pre declared.


Only in tier 2

agk::SetParticlesAngle the particle sprites are drawn rotated according to the above parameters


Are they being drawn as quads or point sprites? You can use GetParticleDrawnQuadCount() to find out. It is impossible to rotate point sprites, and the quads have no rotation code in them, so I can't see how it is rotating the image.

I found that the Percentage Display will leave a Black border around the right and bottom


I could not replicate the efefct in tier 1, can you post your code?

GetFileExists() is crashing


Can't replicate in tier 1 on windows, can you post some code?
Posted: 22nd Aug 2011 21:13
@DVader Its not a pause in the music the whole program pauses for a split second when its changed or looped .
Posted: 23rd Aug 2011 0:09
I'm not sure if this has been reported before but anyway. I was going to add some sprites to my game wich allready has about 15 sprites. I was using [Code]Variable= LoadImage(Filename)
CreateSprite(Variable,Variable. For all my sprites and havn't loaded any images without creating sprites of them afterwards.

I loaded all my sprites in the "main.agc" and it worked fine but then I tried to load 10 sprites in a for i loop. The LoadImage command but when it created the sprites I got an error sayng sprite 10007 allready exsits. That makes no sence since the image command would fail if that was true and since I have created 15 sprites allready it shuld fail at 10001 not 7...
Posted: 23rd Aug 2011 1:10
This is what I am using for code.

+ Code Snippet
rem
rem AGK Application
rem
SetDisplayAspect( 0.66 )

image = LoadImage ( "blue.png" )
sprite = CreateSprite ( image )

posx as float = 0.00
posy as float = 0.00
sprSizeX as float = 0.00
sprSizeY as float = 0.00
SetSpriteSize ( sprite, 6.25, -1 )

sprSizeX = getspritewidth(sprite)
sprSizeY = getspriteheight(sprite)



FOR i = 1 to 24
    FOR j = 1 to 16
        newsprite = clonesprite(sprite)
        setspriteposition(newsprite,posx,posy)
        posx = posx+sprSizeX
    NEXT
    posx = 0.00
    posy = posy+sprSizeY
NEXT
//This deletes the original Sprite that was created on line 7
deletesprite(sprite)

do
    Sync()
loop
Posted: 23rd Aug 2011 6:22
Instead of assigning each new sprite to the spite ID of "newsprite" you should give each one a unique ID.
Posted: 23rd Aug 2011 7:04
The actual point of the program was testing the percentage display to see how it would look on screen. I felt it was pointless to track each ID in an array or 384 individual variable names.
Posted: 23rd Aug 2011 9:59
@Paul:
+ Code Snippet
Function CheckLevelExists( Level )
   ReturnValue = GetFileExists( "Levels/level" + Str( Level ) + ".txt" )
EndFunction ReturnValue


I know that the path works because I use the same path for the level loading code and it works fine.

In my code, ( Level ) is only ever 1 at the minute.
Posted: 23rd Aug 2011 10:30
@XanthorXIII - Oh, sorry, didn't realize you were responding to a request for code.

EDIT - LOL, try

SetDisplayAspect( 0.66666666 )

Once I hit that 8th 6, the black border was gone.

Posted: 23rd Aug 2011 14:12
Are they being drawn as quads or point sprites? You can use GetParticleDrawnQuadCount() to find out. It is impossible to rotate point sprites, and the quads have no rotation code in them, so I can't see how it is rotating the image.


They are around 80pixels large so i guess they are bring drawn as quads.

This is only happening on iOs not on Windows
Posted: 23rd Aug 2011 15:32
@XanthorXIII - As Rich says, the display aspect is the cause of the border, the exact figure for 320x480 is 2/3.

@Mobiius - Looks like something to do with having it in a function is causing it to crash. If I call the same code without the function it works, it also works if I declare "ReturnValue" as a global variable. I've let Lee know about it.

They are around 80pixels large so i guess they are bring drawn as quads.


Does it happen with any image or just that one? Can you paste some sample code that replicates the problem?
Posted: 23rd Aug 2011 16:59
Ok, how about
SetDisplayAspect(320/480) will that get me the precision that is needed to handle the correct ratio?
Do the templates need to be updated to reflect that as opposed to just .66 being filled in when creating a game?
Or do we need to call the getdevicewidth/getdeviceheight properties before setting the aspect ratio so that we get the correct width height etc...

Rich - Thanks for the clarification. That really needs to be in the Documentation or at least Nicky's guide.
Posted: 23rd Aug 2011 17:03
Ok I narrowed down the Particles BUG.

This happens only in iOS Tier2.

I start my game as landscape:

agk::SetVirtualResolution (960, 640);
agk::SetResolutionMode (1);
agk::SetOrientationAllowed (0, 0, 1, 0);

This causes particles to come out rotated 90degrees upside down! I tried using various particle images for testing, and the bug is constant.

If I start my game in portrait particles are drawn fine. But as I rotate horizontally they are rotated 90degrees upside down!

Please use irregular shaped particles when testing, as the ones in the samples are symmetrical shaped and the bug won't show.
Posted: 23rd Aug 2011 18:06
If I start my game in portrait particles are drawn fine. But as I rotate horizontally they are rotated 90degrees upside down!


Now it makes sense. I guess point sprites must be drawn at a particular orientation no matter which way up the device is. I may be able to fix it by making a copy of the image at all 4 orientations and switching between them as the device rotates, but for now the only workaround is to use symmetrical images.
Posted: 23rd Aug 2011 18:45
@XanthorXIII - That's interesting, would 320.0/480.0 give a better result since it's float values? Something to ponder...
Posted: 23rd Aug 2011 19:24
Anything that produces 0.66666666 as a result would work, and yes it would need .0 to be sure of a floating point result
Posted: 24th Aug 2011 8:26
I can't run any of the examples. All I get is a small-ish window (I guess the app window) which is completely white and the "busy" mouse arrow.

I then have to kill the task.

This is on Windows 7 x64 running with Admin rights on a Lenovo laptop (8 GB RAM, i7 8 core) recently installed.

I also have VS2010 installed.

Please help.
Posted: 24th Aug 2011 10:47
But all works fine in Windows/Mac using the same code! No need to make 4 versions of the image there! The problem is only ios related

Now it makes sense. I guess point sprites must be drawn at a particular orientation no matter which way up the device is. I may be able to fix it by making a copy of the image at all 4 orientations and switching between them as the device rotates, but for now the only workaround is to use symmetrical images.
Posted: 24th Aug 2011 13:35
Ack!

I'm trying to make my own custom font, using the image joiner, but when I run it, the resulting subimages text file looks like this...

+ Code Snippet
99.png:0:0:64:64
98.png:64:0:64:64
97.png:128:0:64:64


instead of this...

+ Code Snippet
99:0:0:64:64
98:64:0:64:64
97:128:0:64:64


So that's not working. Please fix this!
Posted: 24th Aug 2011 15:29
Just do a search and replace to remove all the .png references in the mean time.
Posted: 24th Aug 2011 17:42
@mobiius - yeah, it's trivial to fix. But, it took me two hours of frustration to figure out I wasn't doing anything wrong!