I hope you will excuse me, I'm trying to figure out as much of this on my own as I can, but I'll likely still have several questions on this topic.
Let's say that I have a screen with a resolution of 2560 x 1440.
I want to create a screen that occupies the entire screen, preferably without a title bar.
This will create a 2560 x 1440 screen, but is it possible to somehow remove the title bar and to force this screen to be opened with the upper left corner located at the upper left of the actual screen?
A collection of various samples and resources which folks can download and link to, to use with examples and wiki code.
We'll build upon this topic as we gather and decide exactly what all resources need to be available here. What we'd like to collect is a nice bunch of basic sound, image, font, and header files, and such, and then users can just point people to this post and say, "Go grab the proper resource from there to run this demo", rather than having 80 direntry.h files on the server and 412 different images around just to illustrate a simple putimage or rotozoom snippet.
Include an archive (e.g. *.7z) in a post? Perhaps I have been spoiled by Discourse where I just drag and drop one into a post as long as it's < 4meg. Obviously that doesn't work here otherwise I wouldn't be asking .
Just a few things I created back in the late 1990s. First a few constants that you may or may not find useful -
Code: (Select All)
REM ******************************************************************
REM * A number of maths constants that have been pre-calculated in *
REM * order to save execution time. *
REM ******************************************************************
REM ******************************************************************
REM * Distance travelled by light in 1 second, minute, hour, day, *
REM * year. Measured in Miles (approximately). *
REM ******************************************************************
REM ******************************************************************
REM * Distance travelled by light in 1 second, minute, hour, day, *
REM * year. Measured in KiloMeters (approximately). *
REM ******************************************************************
Then there is this library of a number maths routines. First the documentation (comments also included in the code) -
Code: (Select All)
REM ******************************************************************
REM * The following routines are entirely devoted to logarithms for *
REM * bases other than e, which is the base used by QB. The base *
REM * used in a particular routine is denoted by the number which *
REM * suffixes Log in the name of the function, with the exception *
REM * of LogX where the user supplies the base. *
REM ******************************************************************
FUNCTION Log2#(x AS DOUBLE)
FUNCTION Log8#(x AS DOUBLE)
FUNCTION Log10#(x AS DOUBLE)
FUNCTION Log16#(x AS DOUBLE)
FUNCTION LogX#(x AS DOUBLE, LogBase AS DOUBLE)
FUNCTION AntiLog2#(x AS DOUBLE)
FUNCTION AntiLog8#(x AS DOUBLE)
FUNCTION AntiLog10#(x AS DOUBLE)
FUNCTION AntiLog16#(x AS DOUBLE)
FUNCTION AntiLogX#(x AS DOUBLE, LogBase AS DOUBLE)
REM ******************************************************************
REM * Finds the y'th root of x. *
REM ******************************************************************
FUNCTION Root#(x AS DOUBLE, y AS DOUBLE)
REM ******************************************************************
REM * Raise x to the power of y. *
REM ******************************************************************
FUNCTION Power#(x AS DOUBLE, y AS DOUBLE)
REM ******************************************************************
REM * Returns x' = x * (x - 1) * (x - 2) ... * 1. Non-recursive! *
REM ******************************************************************
FUNCTION Factorial#(x AS DOUBLE)
REM ******************************************************************
REM * Returns the arithmetic mean (average) and the sample standard *
REM * deviation of the values held in the array In. *
REM ******************************************************************
SUB MeanDeviation(Mean AS DOUBLE, StandardDeviation AS DOUBLE, In#())
REM ******************************************************************
REM * Returns a random number that is constrained to have a *
REM * greater probability of falling within the centre of upper and *
REM * lower bounds. *
REM ******************************************************************
FUNCTION GaussianRnd#(DesiredMean#, DesiredDeviation#)
Finally the code -
Code: (Select All)
OPTION BASE 0
REM ******************************************************************
REM * Pre-calculated constants for use by the logarithmic functions *
REM ******************************************************************
REM ******************************************************************
REM * The following routines are entirely devoted to logarithms for *
REM * bases other than e, which is the base used by QB. The base *
REM * used in a particular routine is denoted by the number which *
REM * suffixes Log in the name of the function, with the exception *
REM * of LogX where the user supplies the base. *
REM ******************************************************************
FUNCTION Log2#(x AS DOUBLE)
IF x < 0.0 THEN
Log2# = 0.0
ELSE
Log2# = LOG(x) * Log2E#
END IF
END FUNCTION
FUNCTION Log8#(x AS DOUBLE)
IF x < 0.0 THEN
Log8# = 0.0
ELSE
Log8# = Log(x) * Log8E#
END IF
END FUNCTION
FUNCTION Log10#(x AS DOUBLE)
IF x < 0.0 THEN
Log10# = 0.0
ELSE
Log10# = Log(x) * Log10E#
END IF
END FUNCTION
FUNCTION Log16#(x AS DOUBLE)
IF x < 0.0 THEN
Log16# = 0.0
ELSE
Log16# = Log(x) * Log16E#
END IF
END FUNCTION
FUNCTION LogX#(x AS DOUBLE, LogBase AS DOUBLE)
IF ((x < 0.0) OR (LogBase <= 0.0)) THEN
LogX# = 0.0
ELSE
LogX# = Log(x) / Log(LogBase)
END IF
END FUNCTION
FUNCTION AntiLog2#(x AS DOUBLE)
AntiLog2# = EXP(LOGOf2# * x)
END FUNCTION
FUNCTION AntiLog8#(x AS DOUBLE)
AntiLog8# = EXP(LOGOf8# * x)
END FUNCTION
FUNCTION AntiLog10#(x AS DOUBLE)
AntiLog10# = EXP(LOGOf10# * x)
END FUNCTION
FUNCTION AntiLog16#(x AS DOUBLE)
AntiLog16# = EXP(LOGOf16# * x)
END FUNCTION
FUNCTION AntiLogX#(x AS DOUBLE, LogBase AS DOUBLE)
IF ((x <= 0.0) OR (LogBase <= 0.0)) THEN
AntiLogX# = 0.0
ELSE
AntiLogX# = EXP(Log(LogBase) * x)
END IF
END FUNCTION
REM ******************************************************************
REM * Finds the y'th root of x. *
REM ******************************************************************
FUNCTION Root#(x AS DOUBLE, y AS DOUBLE)
IF ((x <= 0.0) OR (y = 0.0)) THEN
Root# = 0.0
ELSE
Root# = EXP(LOG(x) / y)
END IF
END FUNCTION
REM ******************************************************************
REM * Raise x to the power of y. *
REM ******************************************************************
FUNCTION Power#(x AS DOUBLE, y AS DOUBLE)
IF ((x <= 0.0) OR (y = 0.0)) THEN
Power# = 0.0
ELSE
Power# = EXP(LOG(x) * y)
END IF
END FUNCTION
REM ******************************************************************
REM * Returns x' = x * (x - 1) * (x - 2) ... * 1. Non-recursive! *
REM ******************************************************************
FUNCTION Factorial#(x AS DOUBLE)
WorkingValue# = 2.0
ReturnValue# = 1.0
DO WHILE (WorkingValue# <= x)
ReturnValue# = ReturnValue# * WorkingValue#
WorkingValue# = WorkingValue# + 1.0
LOOP
Factorial# = ReturnValue#
END FUNCTION
REM ******************************************************************
REM * Returns the arithmetic mean (average) and the sample standard *
REM * deviation of the values held in the array In. *
REM ******************************************************************
SUB MeanDeviation(Mean AS DOUBLE, StandardDeviation AS DOUBLE, In#())
Sum# = 0.0#
SumOfSquares# = 0.0#
StartIndex% = LBOUND(In#)
NumberOfValues% = UBOUND(In#)
FOR Index% = StartIndex% TO NumberOfValues%
Sum# = Sum# + In#(Index%)
SumOfSquares# = SumOfSquares# + In#(Index%) * In#(Index%)
NEXT Index%
Mean = Sum# / NumberOfValues
StandardDeviation = SQR(SumOfSquares# - Sum# * Sum# / NumberOfValues) / (NumberOfValues - 1.0)
END SUB
REM ******************************************************************
REM * Returns a random number that is constrained to have a *
REM * greater probability of falling within the centre of upper and *
REM * lower bounds. *
REM ******************************************************************
FUNCTION GaussianRnd#(DesiredMean#, DesiredDeviation#)
RandomSum# = 0#
FOR x% = 1 TO 12
RandomSum# = RandomSum# + RND
NEXT x%
GausianRnd# = (RandomSum# - 6#) * DesiredDeviation# + DesiredMean#
END FUNCTION
Probably one of my signature code themes, I've played with Plasma the color sequencing method and with Plasma the 2D blobs. This thread is a study of the latter.
________________________________________________________________________________________________
The earliest QB64 file I can find is Ectoplasm more about Ghost busters than plasma the blobs but close enough:
Code: (Select All)
_Title "Ectoplasm" 'mod of Galileo's at Retro 2019-06-22 B+
'open window 256, 256
Screen _NewImage(256, 256, 32)
Randomize Timer
'sh=peek("winheight")
sh = _Height
'sw=peek("winwidth")
sw = _Width
d = 1
Do
'tm = peek("secondsrunning")
tm = Timer(.001)
dr = ran(256): dg = ran(256): db = ran(256)
w = w + 5 / 83 '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< get things moving
For y = 0 To sh
For x = 0 To sw
vl = Sin(distance(x + tm, y, 128, 128) / 8 + w)
vl = vl + Sin(distance(x, y, 64, 64) / 8)
vl = vl + Sin(distance(x, y + tm / 7, 192, 64) / 7)
vl = vl + Sin(distance(x, y, 192, 100) / 8)
clr = 255 / (1.00001 * Abs(vl))
r = .9 * Abs(clr - dr): g = .4 * Abs(clr - dg): b = .5 * Abs(clr - db)
'COLOR r, g, b
'dot x, y
PSet (x, y), _RGB32(r, g, b)
Next
Next
If w > 1000 Or w < -1000 Then w = 0: d = d * -1
_Display
_Limit 200
Loop
Function distance (x1, y1, x2, y2) '//between two points x1,y1 and x2,y2
distance = ((x1 - x2) ^ 2 + (y1 - y2) ^ 2) ^ .5
End Function
Function ran% (sing)
ran% = Int(Rnd * sing) + 1
End Function
All my programming with QB64 so far has made use of a console window where I simply used plain text.
I have a small project in which I would like to use different fonts and text sizes. Does anyone have a few sample clips available to show me how to specify a font to use and how to size that font?
I've been poking at this myself but I'm simply missing something.
So, I'm back and in search of wisdom from all of your wealth of knowledge. I have a program I wrote in QB64, and it works fine. Apparently, there is thinking that it would be nice to integrate it into a website that uses WordPress. And I know squat about WordPress. What I do know says that WordPress sites use HTML, CSS, PHP, or Javascript. Neither of which I know anything about. Is there any outside chance, that there is some sort of conversion process to take QB64 code and turn it into one of those four? Even if it is from the source code? I'm thinking that would probably be what is wanted in the end since it could be maintained within the WordPress site. Probably not, but I figured I'd ask the experts. Thanks, Michelle