Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / App Game Kit 108 Beta 11

Author
Message
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Apr 2013 14:37
I have been getting an occasional crash on my iPod touch 4th gen when trying to log into Facebook. Could be those or the network commands (check the hi fi code for logging into FB maybe?)


this.mess = abs(sin(times#))
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 26th Apr 2013 17:54
I think my iPod Touch is 4th generation (based on color, memory and when I got it). And the full iOS version is 5.1.1.

The crash occurred with the generic template. But, since that does include the Facebook SDK, it might not matter whether you actually call any Facebook functions.

I should be able to test on an iPad 3 iOS 5.1 tomorrow (after the owner, my hubby, gets back from Holland). I'll report if it works on that.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 27th Apr 2013 01:40
I done some chenges to the new template.
If you don't use all the things you can use on iOS, you'll never discover it don't work.


Long life to Steve!
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 27th Apr 2013 20:05 Edited at: 27th Apr 2013 20:12
When will the Mac AppGameKit Player be updated? I will potentially have access to a large testing group if it becomes available soon. It would be great to have (by this I mean the modifiable AppGameKit player included in the development download)

swis
Joined: Tue Dec 16th 2008
Interstellar
Greenster
19
Years of Service
User Offline
Joined: 3rd Feb 2005
Location: US ©
Posted: 27th Apr 2013 21:08
@Clonkex: I also think it's ludicrous to market and protect something you invested money in.. I mean, why not just give it away and fund your future works off the money trees you have growing?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 1st May 2013 04:02 Edited at: 1st May 2013 04:07
Quote: "I think my iPod Touch is 4th generation"


I recently found a crash on the iPad 1 with one of our apps because it was running out of memory. It only had 256MB of RAM and the images we were loading took up about 60MB uncompressed by themselves, after the app got to about 115MB in total it got force closed. The iPod 4th gen also only has 256MB of RAM so it could be the loaded images taking up too much space. The next beta will have code that detects these two devices and if you have used SetIntendedDeviceSize(1024,768) will assume these are low res devices and scale the images down.

Quote: "When will the Mac AppGameKit Player be updated?"


Good question, we tried to update the app but Apple have rejected it saying the it includes entitlements to use the camera and networking but they can't see it using them. After some back and forth and a video showing them these features working everything has gone quiet and I'm not sure it they will approve it.
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 1st May 2013 05:32
Quote: "Good question, we tried to update the app but Apple have rejected it saying the it includes entitlements to use the camera and networking but they can't see it using them. After some back and forth and a video showing them these features working everything has gone quiet and I'm not sure it they will approve it. "

Ah yes sorry to hear about all the fuss with Apple approval You're certainly not the first. Would it possible for me to have a copy to use alongside the byte code?

swis
Joined: Tue Dec 16th 2008
Interstellar
haliop
User Banned
Posted: 1st May 2013 13:34
for next version.. is it possible to get the command


and i really think you should consider start working on 3d physics.
have an awesome time doing what ever you do! you do it well.
Project Nano wouldnot be alive if it wasnt for you guys! so all i can say is , Thank you.

Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 1st May 2013 16:05
Hi Haliop.
It's probably best to send any command requests here:
https://code.google.com/p/agk/

You also might want to take a close look at all of the pending requests first.

I too would like to see 3D physics.

swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 4th May 2013 20:04 Edited at: 4th May 2013 20:09
I have just come across the greatest bug of all time. Not sure if it's me or AppGameKit, but I tried placing a series of strings in a file. To my surprise, the file came out in chinese

and a few missing symbols. The real joy came when I went to translate it...



Edit: wasn't me. The writeLine command works fine. writeString is broken

swis
Joined: Tue Dec 16th 2008
Interstellar
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th May 2013 21:45
WriteString is not broken. It outputs a binary string, not meant to be human readable.

If you open a file written with WriteString in something like Notepad, it just won't display properly at all.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 4th May 2013 23:15
I use reading and writing of files all the time, never had any issues with that either. Except one odd occurrence of closing then opening the same file to write again with append - if you do it too quickly it appears to fail to open it the second time, but other than that no issues.
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 4th May 2013 23:44 Edited at: 5th May 2013 03:24
Quote: "WriteString is not broken. It outputs a binary string, not meant to be human readable."

Ah alright. What's the reasoning behind this?

Edit: After creating a comical program to create broken chinese with writeString, on about the 100th try, it started exporting normally not sure why...

swis
Joined: Tue Dec 16th 2008
Interstellar
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th May 2013 05:30
WriteString, WriteInteger and WriteFloat are for creating binary files that take less space and are not meant to be read by humans.

That type of file is very common in many systems.

Among other things, it makes it hard for someone to rig a game that reads in levels from a file. If it was in human readable text, they could figure out how to make a level easy to pass and get a higher score than they deserve.

Or, there could be things the app needs to use but doesn't want to be visible to the user, and a binary file helps with that as well.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 5th May 2013 13:07
Delete all images command seams to crash agk apps more then rarely ?

I added this in to my Engine and the game started to crash very often.
and after a long bug hunt so does it seam like its this command that seams to crash it all.

Does it not like if you use fixed ids and automated ids?

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 5th May 2013 13:29 Edited at: 5th May 2013 13:31
@Cliff

No, I don't think it does. I had to rewrite huge swaths of code some time ago (and I admit it was beta 8 I think - it may have been fixed) because I used names to start with ("logo=loadimage()" etc) but then later changed to integers. When I code, I make groups of sprites (one set of the menu, one for backgrounds etc) and generally start each new one with a new 1000 interval, so the first group starts at 1, the second at 1000, the third at 2000 etc.

I noticed problems when I got to 22000 (or 23000, I forget which) as it kept saying images were already loaded. It would appear this is the number that the IDE assignments start at when you use variable names instead of integers to assign stuff (i.e. if you use "logo=loadimage()" then logo will be image 22000), and it wasn't cross referencing the ones I had later used.

I also had issue with music that wasn't named as a variable which if I remember correctly was because the variable name of the music ("titletune" etc) was being used in a function and I had to declare it as global or it didn't work - I think that one is fixed.

As a rule though, I only use integers now and I've had no issues at all.
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 5th May 2013 13:46
I think WriteLine should output human readable text. It prints a CR (\n) terminated string to a file.

Ancient Lady:
Sometimes I get human readable output when using WriteString. And sometimes I get Chinese characters. If WriteString was meant to not write readable text then it should never do so. If you want to print readable text to a file, but don't want to print a CR terminated string, then you would be in trouble.

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 5th May 2013 15:27 Edited at: 5th May 2013 15:45
Quote: "No, I don't think it does. I had to rewrite huge swaths of code some time ago (and I admit it was beta 8 I think - it may have been fixed) because I used names to start with ("logo=loadimage()" etc) but then later changed to integers. When I code, I make groups of sprites (one set of the menu, one for backgrounds etc) and generally start each new one with a new 1000 interval, so the first group starts at 1, the second at 1000, the third at 2000 etc.

I noticed problems when I got to 22000 (or 23000, I forget which) as it kept saying images were already loaded. It would appear this is the number that the IDE assignments start at when you use variable names instead of integers to assign stuff (i.e. if you use "logo=loadimage()" then logo will be image 22000), and it wasn't cross referencing the ones I had later used.

I also had issue with music that wasn't named as a variable which if I remember correctly was because the variable name of the music ("titletune" etc) was being used in a function and I had to declare it as global or it didn't work - I think that one is fixed.

As a rule though, I only use integers now and I've had no issues at all. "

The auto ids starts at 10 000 but you can manually assign from 1 and upwards.

There seams to be some crash with delete images like as if it tryes to delete an image that dont exist or something.

Because if i delete them manually and then use delete all images so dosent the crash appear anymore?

I used a manuall id for the main texture and automated ones for the others but the crash continoued to happen even when i made the main texture automated.

This looks to be a similar crash to the one we had with sprites Before?

ps...
but the weird thing is that if i delete the only text obj i use ingame and then use delete all text command so does it also seam to work better ?

This is so weird?

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 5th May 2013 19:42
Quote: "Sometimes I get human readable output when using WriteString. And sometimes I get Chinese characters. If WriteString was meant to not write readable text then it should never do so. If you want to print readable text to a file, but don't want to print a CR terminated string, then you would be in trouble."

This hit's it home with me. We really should be given the option, not an inconsistency.

swis
Joined: Tue Dec 16th 2008
Interstellar
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th May 2013 19:49
Part of the issue is the program used to read the file.

If you use any of the binary write methods to output a numeric value before using WriteString, and then try to read the file in something that expects some sort of formatting (e.g. Notepad or Wordpad) then you can get strange results.

Also, it would help to see the code used to read/write in your apps when you get the Chinese characters appearing. It could be an inconsistency in the app that is producing this.

For instance, if you use WriteString to create the file. Then use ReadLine and then WriteString, you are totally confusing things and the output would not be consistent.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 5th May 2013 20:13 Edited at: 5th May 2013 20:15
AL
I don't have the code anymore. I was printing out integers and strings for debugging. I was hoping for readable output. Sometimes I could read it, sometimes I couldn't. I made a txt file and used Notepad. That always worked in DBP.

Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 5th May 2013 21:54 Edited at: 5th May 2013 21:58
WriteString is giving me readable output. It is writing the ASCII code for each character into a file.



I'm very curious as to what this "binary output" is. How else would you represent a string of characters other than by their ASCII codes with a null terminator?

EDIT:
Nix my curiosity, google cured it. The issue still remains: WriteString does not appear to create a binary file.

swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 5th May 2013 22:05
I have some code to use as an example. I was using this silliness as a test.


swis
Joined: Tue Dec 16th 2008
Interstellar
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 5th May 2013 22:09
All comes out in ASCII for me. Is this what comes out in Chinese characters for you?

Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 5th May 2013 22:13 Edited at: 5th May 2013 22:21
@swissolo, Naphier

Just been playing with the write string command, and time and time again it wrote "hello" no problem. Upon running the example here though it does indeed output chinese/korean characters, but not every time. My guess is that the first written string is the issue, investigating...

EDIT: found something interesting - the errors appear to be nothing to do with the string written because I altered it to assign a variable the randomstring first, display it, then write it - same result. However upon playing, even when notepad displays them as chinese characters, Word does not - it still displays normally in Word.

Was it just notepad you tried???
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 5th May 2013 22:14 Edited at: 5th May 2013 22:16
It used to. If you add this line of code before it starts filling up(before the loop)

it creates chinese again.

swis
Joined: Tue Dec 16th 2008
Interstellar
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 5th May 2013 22:26
Nope, I've added that line and I still get English. I've tried quite a few times now.

I've tried mixing it up with writeLine and still no Chinese.
I tossed in a writeInteger and those are stored in binary as 8-bit ints.

Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 5th May 2013 22:27 Edited at: 5th May 2013 22:29
@swissolo,

found this website (amongst others) that detail this is (apparently) a know notepad issue:
Quote: "Now I remember. Since text files have no metadata the encoding when opening a file is detected by an educated guess. So if you write bush hid the facts and save it as ANSI, when you open it again in Windows XP/NT/2000 it will display chinese characters because it thinks it's unicode"
(from http://superuser.com/questions/211378/how-to-display-chinese-characters-on-notepadhttp://)

Works fine in every other editor I own, including wordpad.
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 5th May 2013 22:33
Quote: "Works fine in every other editor I own, including wordpad."

Even if I use notepad++ (which always works when working with alternative storage types) I still see characters.

Quote: "Nope, I've added that line and I still get English. I've tried quite a few times now.

I've tried mixing it up with writeLine and still no Chinese.
I tossed in a writeInteger and those are stored in binary as 8-bit ints."

hmmm odd

swis
Joined: Tue Dec 16th 2008
Interstellar
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 5th May 2013 22:38
@swissolo,

No offence, but clearly it doesn't always work as you're seeing chinese. Lol. Why don't you run it until you get a file with chinese characters, then upload that file so we can see what we see? Another website was mentioning an old control panel setting that allowed you to extend regional settings to all applications and not just MS products, however this appears to be pre vista only although they said it fix the problem as alot of "guesswork" was taken out. What version of windows are you using?
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 5th May 2013 22:43
Win 7. Also, just to be clear, Notepad != Notepad++. I have tested with both.

This file contains characters for me

swis
Joined: Tue Dec 16th 2008
Interstellar

Attachments

Login to view attachments
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 5th May 2013 22:47
@Cliff,

My apologies, you are right, it starts at 10001 - just as a heads up in case Paul wants to look at it, the issue is still there (though very, very easily worked around so perhaps just a mention in a help file is enough?) - try using
and it will error saying that the image has already been loaded. Oddly, it doesn't seem to happen if you load them in reverse???

I also tried assorted variations of deleteallimages and specifically trying to delete images I know weren't loaded - didn't get any issues myself, but it was very simple code - is it def the deleteallimages line that is dying if it's in a bigger code sample?
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 5th May 2013 22:56 Edited at: 5th May 2013 22:58
@swissolo,

Downlaoded it, and yip it's chinese in notepad, however in wordpad and word it works fine starts with "1 bsmiwqoew".....but this might be a part of the issue:

When trying to copy and paste it from wordpad I can select the entire first sentence but only the initial character "1" is then pasting?

When opening in word 2010 and using the document inspector, it's finding hidden metadata in the properties and flagging it as an error. Not sure if this is normal as I don;t have one that display normally for you, but maybe that's the issue for Notepad. Unfortunately that's the extent of my technical knowledge. Lol.

EDIT: last update - i tried saving through word as a text document and it said it contained elements that were not compatible with plain text documents, so I would say that def is the problem, however Word/Wordpad (at least on my system) aren't having the issue, just notepad.
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 5th May 2013 23:02 Edited at: 5th May 2013 23:03
@Santman
Ah yes you're right about that haha I forgot about wordpad. Readable text or not, the file is clearly broken on the external end. writeLine works fine for such purposes anyways. All of this should really be mentioned in the documentation though.

swis
Joined: Tue Dec 16th 2008
Interstellar
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 6th May 2013 00:54
I've already explained that Notepad does not understand text that does not have UTF-8 assigned as the format. It doesn't understand RTF or word docs, or much. It's interpreting the string as UTF-16 Unicode, whereas it's really ASCII.

You can't just lob characters below SPACE ( Char #32) without facing issues. Likewise the range 240 to 255 can have unusual side effects, since some values in there may be multi-byte encoding sequence prefixes.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 6th May 2013 01:08
Okay, WriteString outputs basic ascii, but puts a null character to indicate the end of the string. That is what makes it a 'binary' output. WriteLine outputs basic ascii and puts an end of line character at the end.

If you use WriteFloat or WriteInteger, the output is four bytes representing the internal binary format for the numbers and is not human readable at all.

If you use multiple WriteString commands, the null character at the end of the string might mess up a program used to view the file.

The WriteLine and ReadLine commands are meant for dealing with files that are meant to be purely text (and human readable).

The WriteString/Float/Integer and ReadString/Float/Integer commands are not meant to be used on human readable files.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 6th May 2013 01:31
Quote: "Okay, WriteString outputs basic ascii, but puts a null character to indicate the end of the string. That is what makes it a 'binary' output. WriteLine outputs basic ascii and puts an end of line character at the end.

If you use WriteFloat or WriteInteger, the output is four bytes representing the internal binary format for the numbers and is not human readable at all.

If you use multiple WriteString commands, the null character at the end of the string might mess up a program used to view the file.

The WriteLine and ReadLine commands are meant for dealing with files that are meant to be purely text (and human readable).

The WriteString/Float/Integer and ReadString/Float/Integer commands are not meant to be used on human readable files"

This is a solid explanation, but once again, it ought to be in the documentation to avoid this kind of confusion

swis
Joined: Tue Dec 16th 2008
Interstellar
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 6th May 2013 02:08
Yeah looks like an odd encoding issue.
Notepad++ reports that it thinks it is UCS-2 LE w/o BOM which is UTF-16 Unicode.
Even more strange is that if I try to change the encoding in Notepad++ to ANSI UTF-8 it is just garbage characters.
If I look at it in BinViewer it displays the text correctly.
I agree that if WriteString/Float/Int are writing in binary then it should at least be mentioned in the documentation.
But glad this is NOT a bug an just a format issue.

I highly recommend that everyone has something like BinViewer to read files. It is pretty awesome.

http://www.gbresearch.com/binviewer/

JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 6th May 2013 11:22
Try changing the encoding to ASCII in Notepad++ (although they are effectively the same).

Useful analysis of the various encodings here: http://en.wikipedia.org/wiki/Byte_order_mark

So maybe it would be clearer if the method was WriteZTString()

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 6th May 2013 18:41
Quote: "Try changing the encoding to ASCII in Notepad++ "

hmmm I don't seem to have that option in the encoding list

swis
Joined: Tue Dec 16th 2008
Interstellar
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 7th May 2013 21:18
Quote: "No, I don't think it does. I had to rewrite huge swaths of code some time ago (and I admit it was beta 8 I think - it may have been fixed) because I used names to start with ("logo=loadimage()" etc) but then later changed to integers. When I code, I make groups of sprites (one set of the menu, one for backgrounds etc) and generally start each new one with a new 1000 interval, so the first group starts at 1, the second at 1000, the third at 2000 etc.

I noticed problems when I got to 22000 (or 23000, I forget which) as it kept saying images were already loaded. It would appear this is the number that the IDE assignments start at when you use variable names instead of integers to assign stuff (i.e. if you use "logo=loadimage()" then logo will be image 22000), and it wasn't cross referencing the ones I had later used.

I also had issue with music that wasn't named as a variable which if I remember correctly was because the variable name of the music ("titletune" etc) was being used in a function and I had to declare it as global or it didn't work - I think that one is fixed.

As a rule though, I only use integers now and I've had no issues at all. "

Thanks for the input
I know i didt answer Before i belive ?
But i have bin buzzy Writing our own auto id and delete all command for van b and my Project.

I got so upset with the random app crash and our Project use alot of media that gets switched during runtime.

I have so far only finished it all for sounds and images and already have the crashes bin decreased alot so far.

subimages,sprites and objects left and then will we see if they stop completely?

There where some errors in my code also on the way where we created new auto ids while not deleting old ones and as delete all Always crashed so do i belive we got an high number on auto ids?

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 7th May 2013 23:52
Issue with getimage/clearscreen

Not sure if this is me being daft, but I can't seem to get this working. I am trying to generate a screen and then grab that as an image. My understanding from the (somewhat conflicting) help files is that you: setclearcolor, clearscreen, set up whatever it is you want captured, render(), getimage(), and finally clearscreen() again.

Everything is fine, except that setting clearcolor does not fill the backbuffer with my chosen color as the help says it should - the background is always transparent (which I do not want). Secondly, the clear screen doesn't seem to work either as all other active sprites are grabbed too, even after clearing the screen.

I've tried clearing the screen then updating, then doing my scene, then updating also - no joy.

Does anyone know what is wrong?
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 8th May 2013 02:21 Edited at: 8th May 2013 02:22
This little tidbit was mentioned on Lee's FPSC blog. Not a big issue other than you must recompile your Bytecode if migrating from 107 to 108.

Quote: "A quick note for AppGameKit users is that we have corrected a fundamental issue with one of the early commands 'OpenToWrite' but it also means there is no longer forward compatibility between a 107 byte code file and the latest 108 player so any old apps would need to be recompiled. It's not super critical but if you find your apps showing decimals instead of integers when you use STR() command, you will know why!"
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th May 2013 10:20 Edited at: 8th May 2013 10:23
Quote: "Issue with getimage/clearscreen

Not sure if this is me being daft, but I can't seem to get this working. I am trying to generate a screen and then grab that as an image. My understanding from the (somewhat conflicting) help files is that you: setclearcolor, clearscreen, set up whatever it is you want captured, render(), getimage(), and finally clearscreen() again.

Everything is fine, except that setting clearcolor does not fill the backbuffer with my chosen color as the help says it should - the background is always transparent (which I do not want). Secondly, the clear screen doesn't seem to work either as all other active sprites are grabbed too, even after clearing the screen.

I've tried clearing the screen then updating, then doing my scene, then updating also - no joy.

Does anyone know what is wrong?"

If you want a coloured background you will need to create a blank sprite set to the colour you want behind your objects. The following code would be fine after you use clearScreen() before you grab your image.


Edit: If you want to have a grabbed image that does not have any unwanted sprites you will have to use "drawSprite" for all the sprites you actually do want drawn. Otherwise you could offset the view well away from your scene and grab an image from that offset. I've done this to avoid this problem before (in Squashies World I think)...


this.mess = abs(sin(times#))
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 8th May 2013 11:02
@baxslash

Thanks for answering. Does this work for you? I tried draw sprite, however if I set up a sprite, draw it, delete the sprite and grab there is nothing there. I took this to be the same as paste sprite from dbpro, however it appears to do nothing.

Also, the help file says that if setclearcolourenabled is on, if you set a clear colour then use clear screen it will fill the back buffer with this color... It does not. Realistically, clear screen appears to do nothing?

Another odd thing, the image I am trying to grab is a minimap of the level, and this is done before any sync commands at all, no drawing or anything. I make sprites for the screen features first, but neither sync or update are ever called, so the backbuffer should be blank.... It is not, all sprites are drawn.

These two commands at minimum are surely broken?

As is, at 1am I got around it by hiding every sprite, setting up the minimap using 2000 nee sprites, grabbing, deleting the new sprites and then showing all the original ones gain..... But this is hardly the fastest method and should be possible as you say by clearing the screen, drawing 1 sprite over and over, grabbing and clearing again.
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 8th May 2013 18:59
@Santman
There were issues with the SetClearColor and GetImage.
I had to call SetClearColor(0,0,0) immediately before ClearScreen to get rid of a previous call to SetClearColor.

Now it appears that any background color is not captured as you're experiencing.

Maybe this code will help find your other problems?


StOrM3
20
Years of Service
User Offline
Joined: 24th Sep 2003
Location: Cyberspace
Posted: 9th May 2013 19:14
Paul:

There are Issues with the template_android and facebook projects for tier2, I've tried the android tools fix project and it doesn't make the red x's go away on the template_android project, it says it can't write to jarlist.cache also.. Anyways I am attaching a screenshot of eclipse with the errors from loading template_android and facebook projects after everything has been setup as it should, I already had it compiling my old template for android just fine, so something is definitely not right in this release... Thanks..

Ken Cornett aka StOrM3

[PKE] Pain Killa Entertainment(tm) [PKE]
[PKE] Of All The Things I've Lost..[PKE]
[PKE] I Miss My Mind The Most! [PKE]

Attachments

Login to view attachments
Ched80
13
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 11th May 2013 23:49
Are there any plans to add a "SetViewAngle" command? We have set view offset and zoom, but view angle seems missing. It would enable the view to be rotated without having to reset the physics and gravity and produce a cool visual effect. A few indie games use this effect, like Thomas was alone.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 12th May 2013 09:12 Edited at: 12th May 2013 09:15
I agree this would be useful. It's not so hard to calculate positions yourself and use an invisible physics world to get positioning data for physics objects. Someone posted an example of this and it was pretty fast from what I remember...

Edit: here it is http://forum.thegamecreators.com/?m=forum_view&t=197812&b=48


this.mess = abs(sin(times#))
Ched80
13
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 12th May 2013 16:22
Cheers bad, and cheers swissolo that'll come in handy

Login to post a reply

Server time is: 2024-06-26 13:48:02
Your offset time is: 2024-06-26 13:48:02