|
Post by johnno56 on May 15, 2019 22:38:41 GMT -6
Is it possible to have multiple canvases within one Window or do I have to create multiple windows with their own canvases? I hope I am making sense...
J
|
|
|
Canvases
May 15, 2019 23:21:40 GMT -6
via mobile
Post by tbird on May 15, 2019 23:21:40 GMT -6
You can have multiple canvases in a window, just set your dimensions and your set. Remember to set the active canvas before you perform operations for a certain canvas.
|
|
|
Post by johnno56 on May 16, 2019 1:57:05 GMT -6
Cool... I'll give it a try and get back to you... Thank you.
|
|
|
Post by johnno56 on May 16, 2019 2:09:50 GMT -6
Worked like a charm... Thank you.
|
|
|
Canvases
May 16, 2019 6:27:04 GMT -6
via mobile
Post by tbird on May 16, 2019 6:27:04 GMT -6
No problem, curious what your making lol.
|
|
|
Post by johnno56 on May 16, 2019 8:26:26 GMT -6
I am trying to convert my sdlbasic version of Super Star Trek and needed to see if I could replicate the 3 main viewing windows. Two across the top half of the screen and the third will span the bottom of the screen. A whole lot of fiddly edits...Could take a while...
It's after midnight and I have to be up early in the morning. My wife and I usually go out for coffee before she heads off to work. It would be a good idea NOT to fall asleep during breakfast... lol
|
|
|
Post by n00b on May 16, 2019 8:35:21 GMT -6
Canvases are basically the same as sdlBasic's screens. There are only 8 canvases per window in rcbasic as opposed to sdlBasic which has 16 total screens you can use. I chose this limit to make the render loop run faster on Android.
|
|
|
Canvases
May 16, 2019 14:55:00 GMT -6
via mobile
Post by tbird on May 16, 2019 14:55:00 GMT -6
I am trying to convert my sdlbasic version of Super Star Trek and needed to see if I could replicate the 3 main viewing windows. Two across the top half of the screen and the third will span the bottom of the screen. A whole lot of fiddly edits...Could take a while... It's after midnight and I have to be up early in the morning. My wife and I usually go out for coffee before she heads off to work. It would be a good idea NOT to fall asleep during breakfast... lol Where is your sense of adventure? 😆 Also super star trek...I am intrigued. I liked babylon 5 better myself but star trek has eaten up many of my younger hours also.
|
|
|
Post by johnno56 on May 16, 2019 15:50:58 GMT -6
I have been a follower of Star Trek since the 6th of September 1966. (except for the hideous animated series - 1973 to 1975) It is only logical that a Basic Star Trek game be made. I still have the original 1978 David Ahl book that contains the original Super Star Trek program. I have keyed in that game many times for different 'flavours' of basic over the years. Now it's RCBasic's turn. I am not using the original listing. I modified a Basic256 version to run on SDLBasic and evolved from there... The adventure continues...
I will admit that I have watched a few episode of B5 but couldn't 'get into it'. I will make an effort to be more objective by watching from the first episode...
Fully caffeinated. Keyboard is now 'warmed up'... To boldly go... or in my case, 'baldly'... lol
|
|
|
Canvases
May 16, 2019 16:26:22 GMT -6
via mobile
Post by tbird on May 16, 2019 16:26:22 GMT -6
Its a different show and as such different taste lol, it was the first show where conflicts werent resolved over 1 or 2 episodes and each season had a story arc which consisted of a year on the station, the main downside of the show is that it was one of the first if not the first show to incorporate so much cgi...which has aged horribly and the set pieces from star trek look far more attractive even being 20 years older lol.
Can't wait to play your version of SST.
|
|
|
Post by johnno56 on May 16, 2019 17:39:41 GMT -6
I was only a lad when Trek first aired. The acting was cheesy and the sets were obviously fake and the colours - which I had to wait until 1975 to see - where contrasting to say the least. Obviously necessary to show up in black and white... lol The original series is still good for a chuckle...
The conversion is going slower than I had anticipated, but converting, none the less. The version I had made still has random features and still needs a LOT of work... but it was playable - before the conversion... lol Anyway, do not get too excited... It's not THAT good... lol
|
|
|
Canvases
May 16, 2019 17:50:45 GMT -6
via mobile
Post by tbird on May 16, 2019 17:50:45 GMT -6
You havent dissapointed yet johnno so expectations are high 😆
|
|
|
Post by johnno56 on May 18, 2019 0:53:40 GMT -6
I think I am going to have a minor problem with the Star Trek conversion...
Creating the 3 canvases within the one window works fine. Placing images within at least one canvas also works fine. I haven't got far enough into the conversion to test the second canvas and the third is primarily for input and output of instructions and messages. Herein lies my problem. Canvases will happily receive anything that is "Drawn", DrawText(); DrawImage(), but inputing instructions and receiving text messages... Not so much. I have targeted a canvas (Canvas(0)) and used print "messgae" and fprint("message") and message$ = inputs"Input command" and they are all directed to the console. Not exactly conducive to they way it's supposed to go...
There are a couple of work around's that might do... a keyboard-draw-text thingy system (I don't know what you call it) You type and the text is drawn on a canvas or multiple mouse click buttons...
I would like some suggestions before I end up spending too much time on this project...
... maybe a nice game of Pong?
|
|
|
Post by tbird on May 18, 2019 7:36:47 GMT -6
johnno I would direct you to the "TEXT EDITING" in the manual.
Quick Example:
WindowOpen(0, "Text Test", 0, 0, 800, 600, 0) CanvasOpen(0, 800, 600, 0, 0, 800, 600, 1) Canvas(0)
LoadFont(1, "Adler.ttf", 36) SetColor(RGB(20, 255, 50))
DIM userInput$
ReadInput_ToggleBackspace(True) ReadInput_Start()
While NOT Key(K_ESCAPE) ClearCanvas() userInput$ = ReadInput_Text() DrawText("UserInput: " + userInput$, 100, 50) DrawText("Hit 'Ctrl' + 'R' to reset text.", 100, 100) If (Key(K_LCTRL) And Key(K_R)) Or (Key(K_RCTRL) And Key(K_R)) Then ReadInput_SetText("") 'Here you can set the text to say, an incoming message. End If Update() Wend I hope that is what you are looking for.
|
|
|
Post by johnno56 on May 18, 2019 9:08:15 GMT -6
Cool...
So... Replace K_ESCAPE with K_RETURN and reassign or use userInput$ as a command... Cool...
This will work when entering commands. Because the canvas is always cleared prior to a general command. So the x,y pos of the input is fixed.
There are some other commands where the potential "y" pos is not fixed. eg: If multiple enemies appear on the screen, each enemy is dealt with in turn, and the text response/input will displayed directly after the preceding line of text. I'm not sure I'm describing it clear enough. A bit difficult to show you when the game in RC is not complete. If I can, I will attempt to show you some sdlbasic screen shots, then hopefully that will make it easier...
But, as I said before, this routine will do just fine for fixed single inputs... Thank you. (Cool font by the way...)
It's after 1am and I have to be up early. Best get some sleep first...
|
|