Qbasicnews.com

Full Version: Trancparency in PUT?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I would be interested to know if such a thing exists as trancparency in the PUT statement. If this command does indeed exist, please elaborate to the fullest extent possible.

Anonymous

put (0,0), myimage(0), trans
Docs\gfxlib.txt: PUT
I got it. Now... I have this program.

Code:
declare sub Init
declare sub LoadSprites

Init                       'Calls the Init sub that inits the screen and varibles.
LoadSprites                'Calls the LoadSprites sub that loads the sprites.

put (1, 1), Grass

sub Init
cls       'Clears the screen
screen 18 'Puts the screen to 800 * 600 pixels with 32 bit colors.
end sub

sub LoadSprites
dim shared Grass(256), John(256), Wall(256) 'Sets up an array for each sprite.
bload "grass.bmp", Grass   'Loads the grass sprite into memory.
bload "john.bmp", John     'Loads the "John" sprite into memory.
bload "wall.bmp", Wall     'Loads the wall sprite into memory.
end sub

Seems simple... on line 7 (the put line) It says expected: idenifier. That is all it says! HELP!
Grass is never initialized..

You cant DIM SHARED inside a procedure (sub/func.)


Also:
Put (x, y), @array(index) [, parameter]

Anonymous

i could be wrong, but i think you should only use "@" if you are "put"ting a pointer...
Nope..

If you use a pointer you dont need the @

If you're PUTing an array, you need the @

Anonymous

Erm, no, if you dont use a "@" with a pointer it crashes (spoken from experience here......)

Code:
If Not char[0].invisflag Then Put (char[0].x - camerax%, (char[0].y - 8) - cameray%), @char[0].anim[0].image[dirframe + (char[0].control[0].anim.frame * char[0].anim[0].arraysize)], trans

=P it will crash without the 'at'
*cough*

DUH! Tongue


ptr[num] = not a pointer..

When you do [] on a pointer, you get the value held there, the type will be set to that of the pointer, for example, ubyte.

Try:
Code:
dim bptr as ubyte ptr

put (x, y), bptr, pset

Anonymous

youre right =) but im pretty sure for scalar arrays you dont need '@', as that was the way qb did it... and i used fb put before i even knew what '@' and pointers were ;p
Pages: 1 2