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 Studio Chat / Text Manual Scroll question

Author
Message
haliop787
4
Years of Service
User Offline
Joined: 22nd Mar 2020
Playing: With reality.
Posted: 25th Mar 2020 08:29
I have a txt file, where i divided it by lines. each line may different in length.
made a simple text object, and added a max Width to it.

so, every time a different line is being random selected it may or may not need a scroll, so i have added a side bar with a little button to make it scroll.
and i want all scrolls to be the same, meaning, if i have a crop square of that text i want that the top line and the bottom line will always be at the same spot in case of scrolling it.

using TextY manipulation, TextTotalHeight, and obviously the the ScreenHeight(as the side bar where the scroll button appears is trough all the screen height) , and the position of the ScrollButton.

Wow for the past 2 days i have tried everything to make it work. like any combination of known(to me) mathematics but it just dose not seems to work. and i really do not want to separate it to "Lines" because i might want to enter some Pictures PDF style when than i will need to come back to TextTotalHeight or ImageTotalHeight...

so for the example, lets say the current text written inside the Text Object (with the width restrictions) makes it 100 lines so about 1000 height. and next time it will be 57 lines so about 570 in TotalTextHeight , if i scroll it i want both scrolls to stop at the same place at the bottom inside the cropped text area. i have seen an example of Baxslash but there he divide the text into lines which may not be good later on.

Thank you for your time, Nadav aka Haliop.
p.s

I Hope everything is OK with you guys, all around the World. (its been a while since I've been in the forum)
TamBam
12
Years of Service
User Offline
Joined: 29th Nov 2011
Location: India
Posted: 27th Mar 2020 20:29
Could not understand clearly .
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
haliop787
4
Years of Service
User Offline
Joined: 22nd Mar 2020
Playing: With reality.
Posted: 31st Mar 2020 10:10
Wow Scraggle this is exactly what i needed. however then i remembered i am talking about Smart Phones and that the old windows style scrolling might not be the right choice here. so i went with 2 buttons that fixed most of it but then there is still an issue of how much to scroll down and stop so there wont be too much black on screen.
maybe there is a way to see if the Text is cropped at bottom / top / left / right by choice, like "GetTextCropedVertical(txtId)" so 0 is no crop at all, 1 is crop at top and -1 is crop at bottom.
if all of agk community will have this small feature implanted right in, there will be no need for math here.. since you can simple decide how to crop a text with the Crop command Scissors like of the text already in.
then people can really make no mess with it.. i stuck for it for like 3 days until i got to a decent point but when i reassigned new resolution on different devices it was messed up all over again i will put a request for such a command.
if you really think about it, if you get a flag for cropped text at bottom or top left or right , you will have instant results no matter how you are going to scroll your text no matter the MAxWidth or MAxHeight which can then enable quickly to add Increase font size , increase line space etc for people with sight disability and that is while keeping the code extremely clean and since we have in Israel for example a regulation where you must put extra thought on design to Users with disabilities as a law.
haliop787
4
Years of Service
User Offline
Joined: 22nd Mar 2020
Playing: With reality.
Posted: 31st Mar 2020 10:28
added a new Issue. i explain it much better here
not an issue but a request.

https://github.com/TheGameCreators/AGK-Studio/issues/633

Login to post a reply

Server time is: 2024-03-29 06:08:40
Your offset time is: 2024-03-29 06:08:40