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 Chat / [SOLVED] Visual Editor and Print() function

Author
Message
Zagaroth
1
Years of Service
User Offline
Joined: 10th Apr 2017
Location:
Posted: 9th Nov 2018 01:06
So I bought the visual editor about 3 weeks ago and I have managed to rebuild an old program most of the way using the editor. I really like how easy it is to place and adjust sprites. However, I am having a few issues.

1. The Print() function does not seem to do anything anymore.
2. When editing sprites there seems to be a delay between the "click" and the affect, and things have started to hang up all together

I realize that this could just be my code so here is a snip of what im doing:

The author of this post has marked a post as an answer.

Go to answer

fubarpk
AGK Developer
Gold Codemaster
13
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 9th Nov 2018 03:14 Edited at: 9th Nov 2018 03:16
In your code the print statements will only flash on and then off very quickly probably too quick to notice

and why are you using VisualEditor_Update ( ) twice when I would've thought it should be only once before sync()
fubar
smallg
Valued Member
12
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 9th Nov 2018 18:27 Edited at: 9th Nov 2018 18:28
You have 2 (sometimes 3) syncs being called in a single frame in your code - you don't need the sync in the middle of the code.

To reinforce what fubarpk said, your print isn't showing because getpointerpressed is only true (or 1) for 1 frame when the screen is first registering the touch (at 60fps that means it's 1/60th of a second it will display that print but as you have multiple syncs it's probably even less as it's clearing the screen even more often)... You will want another way to display those prompts.

For slow down, are you talking about in the visual editor or in AGk or in the final game?
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
Zagaroth
1
Years of Service
User Offline
Joined: 10th Apr 2017
Location:
Posted: 10th Nov 2018 01:50 Edited at: 10th Nov 2018 01:54
So the multiple visualEdito_update may be an issue but the sync () is there to update the screen to show the changes to the sprite. If I only put one sync() at the end of the do loop I wouldn't be able to see anything that has changed because it changes with the if statement and changes back with the case. I am in no way a pro when it comes to coding so please let me know If I am completely miss understanding how this works. This is just how I have seen it work with my trial and error.

The slowness is when pressing a button not the final game. This project is not completed but it was working without the visual editor being used. I rebuilt it using the visual editor due to the easy of adding and adjusting sprites.

As for the getpointerstat, it was staying up if I held down the mouse button before adding the visual editor code.

I greatly appreciate the replies!
Zagaroth
1
Years of Service
User Offline
Joined: 10th Apr 2017
Location:
Posted: 10th Nov 2018 05:00
I took your advice and removed all the sync()'s except one and low and behold the code worked great. Thanks guys.

Still not seeing the print()s that are in the code though. I even added one directly to the do loop just to test and nothing.
smallg
Valued Member
12
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 10th Nov 2018 09:47
This post has been marked by the post author as the answer.
Excellent
Have you tried changing any of the print values? Like size or colour with SetPrintSize(#) etc? If you put those above the main do loop it might help make sure it's not just that the text is the same colour as the BG etc. (Keep the print in the loop).
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
Zagaroth
1
Years of Service
User Offline
Joined: 10th Apr 2017
Location:
Posted: 10th Nov 2018 14:18
100% correct! The color of the print was the same as my background. Change the color and all the prints show up! Thanks so much!

Login to post a reply

Server time is: 2018-11-18 04:47:16
Your offset time is: 2018-11-18 04:47:16