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 / TTF fonts messes up during runtime if in fullscreen

Author
Message
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 27th Feb 2017 11:31
I have a medium sized project where I use TTF, when running in window everything is fine, but when changing a text string while in fullscreen, the changed characters also changes size. I have been trying to re-create the problem in a small snippet but there everything is fine. I have to leave the house soon, but I was hoping someone could give me some clues to the problem, or have experienced the same thing. I run AGK2 on Windows 10 x64.
13/0
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 27th Feb 2017 14:29
Are you using a virtual resolution or percentage based coordinates? The only other thing I can think of is if the text Y size goes beyond 200 pixels (not virtual or percentage coordinates) then AppGameKit switches to stretching rather than re-rendering the text, which might be messing up.
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 27th Feb 2017 18:35 Edited at: 27th Feb 2017 18:36
I think it is due to virtual resolution. I have been messing with it earlier today trying to create a snippet that reproduces the error, and I noticed that virtual resolution had an significant impact on text size, but never changed the text size during runtime like it does in my project. And I remembered that I change virtual resolution somewhere in the frame for some render purposes. I will report back when I have had a look on it.

EDIT: No, I don't do anything with virtual resolution during the frame :-(
13/0
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 1st Mar 2017 12:03
I tried my app on a Windows 7 computer in fullscreen today, and the bug/artefact does not happen there :-P
13/0
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 2nd Mar 2017 11:30
Here is an image of what happens. Only when a character is changed in a text object, the size of that character will change, and only when running in fullscreen window. This does not happen on my other computer with Windows 7 with the same app.

13/0
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 2nd Mar 2017 13:30
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 2nd Mar 2017 13:52
There is an image. A photobucket attached one.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 2nd Mar 2017 14:39
What method do you use to change the character, and how do you set up the text object?
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 2nd Mar 2017 14:49 Edited at: 2nd Mar 2017 14:51
Here is the setup:



And here is what I use to change it:



EDIT: Just to clarify, it happens to all text in the app, not just what I have shown here.
13/0
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 2nd Mar 2017 17:17
Unfortunately I can't seem to replicate this. Do you change the window size between creating the text and changing it (whilst keeping the virtual resolution the same)? Do the Windows 10 and Windows 7 have different desktop resolutions? The bug might only present itself when the full screen window is a certain size.
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 2nd Mar 2017 18:16 Edited at: 2nd Mar 2017 18:20
The Windows 10 machine runs 1920x1080, I think the Windows 7 machine runs 1280x720, the app is set to 1280x720 both in window size and virtual resolution. I tried to change the resolution on the Windows 10 PC to 1280x720, then it does not change the size of the letters BUT, then the screen is blinking a lot.

EDIT: And the window size is set up at the start of the app, in the options menu you can change to fullscreen, but the windows resolution and virtual resolution never changes after the initial setup.

EDIT 2: I am not keen on posting my whole game source on a forum, but I am willing to mail it to you. I will post the game in Showcase when I am more confident with it. If you want me to send it, promise not to laugh too hard when you see my awfull code and game :-P
13/0
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 3rd Mar 2017 00:49
Taking a look at your project may be the only way to track it down. I won't judge, I think we've all written code we're not proud of
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 3rd Mar 2017 08:55 Edited at: 3rd Mar 2017 09:08
I have made a zip file with game client, game server and lobby server. You can start them in any order, but lobby and game server have to be online before you can play. You need to start two clients, log on to the game server, select a character on both clients (arrow keys and enter), you then press F1 to start the game (select characters on both clients before pressing F1, I have not yet fixed that the game should not able to start with only one character selected), they will load for a while. You can set the game to fullscreen in the options menu. You move on the arrow keys and shoot on WASD, if you selected a controller then it is left stik to move, right stick to shoot. You select weapons on 1, 2 and 3, or X, A and B on a Xbox 360 controller.

Where do I send you the zip file? EDIT: I sent you a link in a PM.

I will try and set the Windows 7 PC to 1920x1080 today to see if it will also happen there.

EDIT 2: I just confirmed that the artefact also happens on my Windows 7 PC when running in 1920x1080.
13/0
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 3rd Mar 2017 11:51 Edited at: 3rd Mar 2017 11:56
UPDATE: When you look at my code, it is the SetRenderToImage(map_render_image,0) and SetRenderToScreen() that causes the artefact. Removing those two lines removes the issue. I use that so I can have infinite blood, bullet holes and debris on the map.

UPDATE 2: I fixed it :-P

I use this in load_map:
if fullscreen = 1
map_render_image = CreateRenderImage(device_width,device_height,0,0)
endif

instead of:
if fullscreen = 1
map_render_image = CreateRenderImage(1280,720,0,0)
endif
13/0
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 3rd Mar 2017 11:57
Sorry for the inconvenience :-(
13/0

Login to post a reply

Server time is: 2024-11-24 19:43:39
Your offset time is: 2024-11-24 19:43:39