Post by n00b on Aug 2, 2021 15:07:40 GMT -6
You can go to rcbasic.com to download the latest release now. This was a long time coming but I think it was worth it.
First of all, let me just state that this comes with a lot of changes, some of which are going to require you rewrite a lot of your existing code.
CHANGES
BUG FIXES
First of all, let me just state that this comes with a lot of changes, some of which are going to require you rewrite a lot of your existing code.
CHANGES
- WindowOpen() has changed quite a bit. The window modes are completely different and it now takes an additional argument for specifying whether or not you want vsync enabled.
There is also a new function added called WindowMode() that can be used to specify the type of window you want to open. Please read the documentation on this as well as look at the examples. - This goes with the previous point but you can now create resizable windows and have highdpi enabled.
- The joystick api now allows you to implement haptic feedback on controllers that support them.
- There are new functions for reading Accelerometers and Gyroscopes on mobile devices
- You can now get the absolute position of the mouse on the display
- A few functions have been renamed:
- Replace and ReplaceSubstr were swapped. This has been annoying me for years but I just never made the change. Now the names of the functions make more since with what they do.
- RCBasic_Android_Interface was changed to Android_JNI_Message.
- RCBasic_IOS_Interface was replaced with Runtime_Utility_Message. It still does the same thing but can be used on any platform without having to modify rcbasic_build.
- There are over 20 new functions
- write, getglobalmouse, globalmousex, globalmousey, getaccel, accelname, numaccels, getgyro, gyroname, numgyros, joyrumbleplay, joyrumblestop, joystickishaptic, writebytebuffer, readbytebuffer, windowevent_resize, setwindowautoclose, setwindowresizable, systemreturnstdout, windowmode, windowflags, restorewindow, updateallwindows, queryaudiospec
- You can now declare multiple variables and arrays with DIM by separating them with a comma.
- You can make multi-line comments. Look in the documentation on comments to see how that works.
- FOR loops were completely overhauled.
- They will no longer loop until the end condition but instead will only loop when between the start and end conditions.
- You can now use arrays as counters in your loop.
- You can now use offset index in a ByRef argument as a counter your loop.
- ByRef arguments can now be passed as an offset index from an array.
Here is an example of what that looks like:Sub test(ByRef a)
Print a[2]
End Sub
dim x[5]
x[3] = 99
test(x[1]) 'This will output 99 - There were a few bad links in the manual that were fixed.
- You can now put INCLUDE ONCE in a file so that it will only be included once in your build no matter how many other files try to include it. This can be really useful for when you are making a library that makes lots of references to the same files.
- You can now add a number after END to specify the exit code you want your program to end with.
- The CONST keyword was added to allow you to make constant. Constants in RCBasic are constant expressions rather than constant values. Here is an example of how that works:
const my_constant=5
const alt_print=print 'Anything that RCBasic can generate a token for can be put in a constant - You now have the ability to use environment variables in an INCLUDE string. Here is an example of how that works:
'In this include we are using a environment variable we made prior to compiling called my_lib_path
Include "${my_lib_path}/my_file.bas" - New constants for different window flags were added - WINDOW_VISIBLE, WINDOW_HIDDEN, WINDOW_FULLSCREEN, WINDOW_RESIZABLE, WINDOW_BORDERLESS, WINDOW_HIGHDPI. You can combine the with OrBit() but it is recommended to just use the WindowMode() function.
- Finally, one of the biggest changes with this release is the inclusion of distribution tool and the android apk tool. You can now choose what platforms you want to port to by selecting "Distribute your program" from the build menu. From that tool you will also be able to adjust various settings on your app including setting your keystore if you are trying to publish to google play or amazon app store. You will even be able to generate a template java file for adding java code to your project on android.
BUG FIXES
- Fixed a bug that would cause INCLUDE to fail it was the last line in a file.
- Fixed a bug that would cause android to render a black screen if the app entered the background.
- Box(), BoxFill(), Rect(), and RectFill() now draw the rectangle at the appropriate size.
- Touch events are now reported properly when multiple fingers are pressed.
- Variables that are local to functions are now pushed onto the stack on recursive calls. ( Note: Arrays are not so they will keep there values on subsequent calls ).
- FPS() now has its own internal timer for each window.
- A Delay was added to Update() to decrease CPU intensity.
- ArraySize() and ArrayDim() are now parsed like normal functions rather than macros.