Posted 12 June 2014 - 08:16 PM
I have made my own API which has a tool that adds a window for you, I'm making my own window API sort of. Now, instead of like the regular terminal screen when you write text if it's longer than the width it will keep snapping off in word style until it fits the screen, if more space is needed it will scroll along the Y axis. It doesn't scroll to the X, it does scroll to the Y. MY window is customisable, so you can choose wether you want X to scroll or not and Y to scroll or not. If X scrolls, writing text will keep writing it on the same line unless there's an \n or manually use a scroll function to scroll Y or something. If neither X or Y can scroll, then text will snap off the X axis and when it reaches it's end, it will just stop writing unless you change position or something.
My write function will not need to split by words, it will just split along the area of the window even if it has to split words in half. I can take care of the splitting with already preset functions in my API. I can also take care of scrolling with ScrollX, ScrollY or ScrollPos(x, y). I just need sort of logical help for how I could make this work.
Also I use a two-dimensional pixel table for storing each character and colour data of my window. For example if the window is 10 width and 6 height and at the 10, 6 there is a letter C written. win.charsData[6][10] (reversed, it's easier for X handling) will equal to "C".
Can someone provide help here on how I could make such a function that would write as described? I don't want to write over the borders of the window either, I can't think of a way.
Regards
Augustas
My write function will not need to split by words, it will just split along the area of the window even if it has to split words in half. I can take care of the splitting with already preset functions in my API. I can also take care of scrolling with ScrollX, ScrollY or ScrollPos(x, y). I just need sort of logical help for how I could make this work.
Also I use a two-dimensional pixel table for storing each character and colour data of my window. For example if the window is 10 width and 6 height and at the 10, 6 there is a letter C written. win.charsData[6][10] (reversed, it's easier for X handling) will equal to "C".
Can someone provide help here on how I could make such a function that would write as described? I don't want to write over the borders of the window either, I can't think of a way.
Regards
Augustas
Edited on 12 June 2014 - 06:34 PM