AddWindowStyle (W, S, F)

Enables one (or more) Windows Extended Window flags and flags, and thus changes the appearance of a window.

W: Long - Handle of a window, or (forB. HWnd%) or a control (forB. box)

S: Long - the value (s) for Window Style (s), or Extended window style (s)

Q: Long - flag, which styles are used: 0 = Window-Style / 1 = Extended Window Style

Score: 0

This looks like a window can be changed, which is already open. AddWindowStyle () adds

this, the specified Style with S added. This can have a combination of multiple window

His styles. However, the standard Windows styles may not with the extended window styles

be combined! If they want more one (or) extended window style (s) to add, then

must be specified for F is 1, for standard Windows styles a 0

Examples:

(1. Adds Profanfenster a horizontal and vertical scroller added)

(2. Adds a list box adds a window frame and makes the window a tool window. Yes, you really!)

Window 0,0-800,600 'Example 1

AddWindowStyle (% hwnd, $ 300000.0) '(both Scroller add)

(listbox% = Create "listbox", hwnd%, "", 176,8,496,368)

Example 2

AddWindowStyle (% listbox, $ C00000, 0) '(add borders)

AddWindowStyle (listbox%, 1,1) '(tool WindowStyle Trail)

SetText% listbox, "This' is still a list box!" '(Window title set)

Alpha Trans

Alpha Trans (F, X, Y, B1, B2, M)

Mixes two different images transparent one, this is a mask bitmap of the

Transparency level determined for both pictures.

Q: Long - Handle of the target bitmap (HDC) or 0

X: Long - X offset to the screen

Y: Long - Y offset to the screen

B1: Long - First one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (1. source bitmap)

B2: Long - Second handle with a generated PngToFX (), InitFX () or CreateFX () byte array (2. source bitmap)

M: Long - one with a handle PngToFX (), InitFX () or CreateFX () generated byte arrays (mask bitmap)

Result: Long - 0

The graphics of images B1 and B2 are combined, taking into account the mask bitmap M to F.

X and Y specify the upper left corner where they have placed both images. The size of the display

Rectangle is derived from the size of the bitmap that is specified in InitFX () / CreateFX (). The size

of B1, B2 and M, but must always be the same size!

For F can be either one of the most profane bitmaps (% HDC% HDC2 ...) are specified, or one with

Produced LoadFileImage () / CreateImage () was. If for F given a 0, then the expenditure is

not in a HDC, but in the byte array B1!

The data in the byte arrays, B1, B2 and M are not changed by calling Alpha Trans (), it was

then, for F 0 is specified. But even then, only B1 is changed. Otherwise Alpha Trans operates internally

with a fourth memory area.

The mask bitmap M should have a black-gray-white and his image. There are, however, also colored

Mask bitmaps achieve amazing effects.

The more white a pixel in the mask bitmap, the more visible, the pixels of source bitmap 1 (B1). Depending

darker a pixel in the mask bitmap is, the more visible, the pixels of source bitmap 2 (B2).

Two examples of trans-alpha () are in the ProSpeed source code folder.:

AttachSprite

AttachSprite (H, ZH, XO, YO)

Sprite H attempts are automatically promoted to the position, which is located at the Sprite ZH moment, by far the XO, YO.

H: Long - one with a handle

InitSprite () generated sprites

ZH: Long - one with a goal-Handle

InitSprite () generated sprites

XO: Long - X Offset, X-distance to the target sprite

YO: Long - Y Offset, Y Offset goal Sprite

Result: Long - 0

With this function you can realize how great sprite effects, and with little user effort.

In order forPresented as a worm, several Sprite (perhaps chained balls) with AttachSprite ()

will. These hunts Sprite 1, after the sprite 2nd 3 behind Sprite Sprite 2 ago, 4 behind 3, etc., all with

small distance. Now just need sprite 1 are moved, and the other sprites move

wormlike automatically afterwards. It should, however, will have all the sprites, the same speed.

To unlock the Attach for Sprite H again, must be a given zero for ZH:

AttachSprite (attachsprite &, & sprite, 10,10)

...

AttachSprite (attachsprite &, 0,0,0) 'Attachmodus quit again

AttachSpriteAnim

AttachSpriteAnim (H, ZH)

Enlargement

AttachSprite ().H Sprite automatically tries to look exactly like Sprite ZH.

H: Long - one with a handle

InitSprite () generated sprites

ZH: Long - one with a goal-Handle

InitSprite () generated sprites

Result: Long - 0

Very suitable forAs for Jump & Run Games. When in a level more similar-looking enemies

there, they can very easily using AttachSprite () / AttachSpriteAnim () can be realized.

To attach the repeal of Anim Sprite H again, must be a given zero for ZH:

AttachSpriteAnim (attachsprite &, sprite &)

...

AttachSpriteAnim (attachsprite &, 0) 'Attach-Anim-stop mode again

Sections / Tables

 

BitBltArray

BitBltArray (Z, X1, Y1, B, H, Q, X2, Y2, F, V)

Copies a rectangular portion of a byte array to another. If necessary, with or with transparent color mask.

Z: Long - one with a goal-Handle

PngToFX (), InitFX () or CreateFX () generated byte arrays

X1: Long - left coordinate in the destination array

Y1: Long - the upper coordinate of the target array

B: long - width of the rectangle to be copied

H: Long - height of the rectangle to be copied

Q: Long - one with a spring handle

PngToFX (), InitFX () or CreateFX () generated byte arrays

X2: Long - left coordinate in the source array

Y2: Long - the upper coordinate in the source array

Q: Long - Flag

V: Long - additional variable for certain flag F.

The rectangular section of the source array starting at X2, Y2 of a width of W pixels and a height

has H pixels, then the position X1, Y1 copied into the target array.

Aims to determine the last parameter Q, copies of which mode. If F = 0, then the square will

Area normally copied.

If F = 1, then it must be specified in V a transparent color, suchAs RGB (255,255,255). If a

Pixels in the source image that color, it is not copied into the target.

Another flag has the value 2 If F = 2, then it must specify in a V, another handle of a byte array

will. V is a mask image and determines whether the pixel color of Z or Q to dominate. Is

Pixel value in V = 0 (black), then the pixel color of the source is used. If V = 255 (white), then the

Pixel color of the target used. If V = 127, then the source and destination colors are mixed in equal parts

used. The blacker a pixel in the mask is, therefore, the dominant source of color, depending on white, the

dominant target colors

Important! If F = 2, then the mask image showing the size W x H must have!

Miscellaneous clipping (graphics go) on edges must also be prevented by user himself. The

Examines the function fails.

Black White

Black White (F, X, Y, B, P)

Turn a graphic on the screen (or parts thereof) of black and white image.

Q: Long - Handle of the target bitmap (HDC) or 0

X: Long - X offset to screen

Y: Long - Y offset to screen

B: Long - one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (source bitmap)

P: Long - the priority of the effect, 0-255 (127 = normal)

Result: Long - 0

The graphics of the screen is transformed into a black and white image. X and Y enter the upper left corner

to, from where the screen is black with white made. The size of the rectangle resulting from the size

the bitmap that InitFX was specified in () / CreateFX ().

If they call Black and White () inside a loop with varying priority, gives a very

amazing effect!

The lower the priority is, the more predominant the color black, the higher it is, the more predominant

the color white.

For F one of profane can either be specified or a bitmap, with LoadFileImage () /

CreateImage () was created. If passed, but for R 0, the function will be executed but

not brought to the screen.

Black White () is pretty fast and works in real time. Generally, the smaller the area, the faster

work function.

Before the function can be used, must be a preparation with InitFX () have taken place.

The data in the byte array B are produced by calling this function does not change.

= array & InitFX (exhdc &) 'Handle (byte array) to create a bitmap

Black and White (% HDC, 0.0, & array, 127)

FreeFX (array &) 'later release

Blur

Blur (F, X, Y, B)

Blurs the image on the screen (or any part thereof).

Q: Long - Handle of the target bitmap (HDC) or 0

X: Long - X offset to the screen

Y: Long - Y offset to the screen

B: Long - one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (source bitmap)

Result: Long - 0

The graphics of the screen is blurred. X and Y specify the upper left corner, from where the screen

is obliterated. The size of the blurring of the rectangle resulting from the size of the bitmap in

InitFX () / CreateFX indicated () was.

For F one of profane can either be specified or a bitmap, with LoadFileImage () /

CreateImage () was created. If passed, but for F 0, the function will be executed but

not brought to the screen.

Blur () is pretty fast and works in real time. From a 600 processor and a large should

Screen liquefy blurred.

Generally, the smaller the area, the faster works blur ().

Before the function can be applied must be a InitFX preparation with () have taken place.

The data in the byte array B are changed by calling this function ..

Example:

= array & InitFX (exhdc &) 'Handle (byte array) to create a bitmap

WhileLoop 256

Blur (% HDC, 0.0, array &)

EndWhile

FreeFX (array &) 'later release

BringSpriteToBottom

BringSpriteToBottom (H)

Put a sprite in the presentation layer (layer completely down).

H: Long - one with a handle InitSprite () generated sprites

Sprite H will be made against all other sprites in the background and can therefore by any

Sprite others are masked.

An exception is generated, the first sprite, it always remains at the lowest level of representation

must.

BringSpriteToTop

BringSpriteToTop (H)

Sets a sprite in the presentation layer (layer completely) up.

H: Long - one with a handle InitSprite () generated sprites

Sprite H will be made against all other sprites in the foreground and can therefore by no

other sprite longer be covered.

Never use the first generated sprite!

ChangeBytesToWords

ChangeBytesToWords (Q, A1, Z, A2, N)

Converted some or all of the bytes into an area to Word.

An overlap between source and target area is not advisable to use two different areas,

or different sections within an area. Still to remember is that the target area twice

must be as large as the source region, as two bytes containing a word yes.

Q: Long - the source address (egB. range variable)

A1: Long - Offset to the source address

Z: Long - target address (egB. range variable)

A2: Long - offset to the destination address

N: Long - Number of bytes to be converted to Words

Result: Long - 0

Example:

ChangeBytesToWords (area #, 0, field #, 20000.10000)

follows:

Address: 0 1 2 3 4 5 ... 20000 20002 20,004

20006 20008 ...

Value: 111 111 111 111 111 111 ... 111 111 111 111

111

Execution time, 40000 bytes:

Original Secular = 7010 milliseconds

ProSpeed.dll = 1 millisecond

Change Display

Change Display (X, Y)

Changes the screen size without saving it.

Just for one game often requires a screen resolution of z.Example, 1024 x 768 For most

Users, but the screen is set at 800 x 600th With Change Display (), the resolution may be short

be changed just once, and then back again.

Oops, from 2.1 ProSpeed Change Display () can be called with the parameters 0.0. The

ie, the original Windows screen mode, then restored, as the user him in

System has saved. Therefore now no need to store and oldy oldx & & and the original

Frame rate is also restored.

What is new in version 2.7, which is attempted for each mode to obtain the set frame frequency. And

during downshifts of the screen will now no longer the window sizes of other programs changed!

X: Long - Width of the new screen resolution

Y: Long - the amount of the new screen resolution

Results: Long - Error code (0 = no error, otherwise MS_Win32.hlp, Change Display Settings ()), see

Example:

...

Change Display (1024.768) 'screen to 1024 x 768 setting

...

Change Display (0,0) 'screen to revert to the original Windows values

ChangeLongSequence

ChangeLongSequence (B, A)

Reverses the order of the long integer into Area B.

B: Long - range variable, table LongInt values

A: Long - Number of bytes that are affected in the reversal (smooth divisible by 4 of course!)

Result: Long - 0

For example, to change the sequence of long values in range of #. From: 8, 167,800, 56000, 45 would be 45, 56000, 167,800, 8

ChangeLongSequence (area # 16) '16 = 4 Long's a 4-byte, 4 x 4 = 16

ChangeSpritePara

ChangeSpritePara (H, P, V)

Change the various settings manually, a sprite) (only for professionals.

H: Long - one with a handle

InitSprite () generated sprites

P: Long - offset of the parameter

V: Long - New variable for parameter P

Result: Long - 0

For V LongInteger be expected. Here's a list of parameters for which new variables would be useful:

Offset importance

0 HDC the sprite bitmap, where the sprite data store "

4 X offset into the sprite HDC

8 Y offset into the sprite HDC

70

56 the HDC Secular window

68 HDC of Double-Buffer copy 1

84 HDC of Double Buffer Copy 2

92 mode, the background not scroll 0 = / 1 = Scroll

96 X pixels to scroll background

100 Y pixels to scroll background

156 Sprite number marking

312 starting point for MoveSpriteWithTable ()

For example, to assign a new sprite bitmapped data from another HDC inclusive of new offsets:

ChangeSpritePara (handle &, 0, & newhdc)

ChangeSpritePara (handle &, 4, & newx)

ChangeSpritePara (handle &, 8, & newy)

ChangeWordsToLong

ChangeWordsToLong (Q, A1, Z, A2, N)

Transformed to some or all the Words in a field trip to Long.

An overlap between source and target area is not advisable to use two different areas,

or different sections within an area. Still to remember is that the target area is four times

must be as large as the source region since a long as two successive Words (includes 4 bytes).

Q: Long - the source address (egB. range variable)

A1: Long - Offset to the source address

Z: Long - target address (egB. range variable)

A2: Long - offset to the destination address

N: Long - Number of Words that should be changed to Longs

Result: Long - 0

Example:

ChangeWordsToLongs (area #, 0, field #, 20000.5000)

follows:

Address: 0 1 2 3 4 5 ... 20000 20004 20,008

20012 20016 ...

Value: 11123 11123 11123 11123 11123 11123 ... 11123 11123 11,123

11123 11123

Execution time, 40,000 Words:

Original Secular = 10070 milliseconds

ProSpeed.dll = 1 millisecond

CleanUp

CleanUp (M)

Cleans up the internal sprite tables. Each Sprite table whose Sprite marking M and had

(apparently) has been deleted, hereby fully released.

M: Long - marking (for certain sprites)

Result: Long - 0

Each sprite of ProSpeed.dll stores its data in a table. All tables are here together

concatenated. Now, when a sprite is deleted, its table marked as deleted, but there

so long, until the last sprite was deleted. This is a good thing, should therefore still on a Sprite

be accessed, although it has already been deleted, simply nothing happens. If the complete

Table memory for the sprite completely erased, then it would otherwise be a fun fall ...

CleanUp () cleans up and deletes all the tables properly marked with M, are no longer needed.

CleanUp () should nevertheless not be carelessly used, possibly because features such as CollideMore ()

thereafter, may receive incorrect values, suchAs sprites, whose memory does not exist any more. If, however, very

have initiated many sprites and deleted again, is CleanUp () now and again a very useful and speeds up

the whole sprite thread again.

When they work in their sprites have no label, you can specify for M zero.

Oh yes, several CleanUp () should - functions are not consecutive, otherwise only the first

is executed. Namely, the function does not work immediately (of course, but immediately returns to the main program

back), but only at the appropriate place in the sprite thread. A possible solution for several CleanUp ()

Calls within a continuous loop would be:

& x = Rnd (3)

Case & x = 0: CleanUp (20)

Case & x = 1: CleanUp (114)

Case & x = 2: Cleanup (34)

ClearWith

ClearWith (V, A, B, N)

Deletes a part of an area (or all) with a specific value (byte format).

Inspired by the profane command

Clear has been implemented this feature, but who are not just

Delete with zeros can, but with all values between 0 and 255

V: Long - range variable

A: Long - Offset

B: Long - byte, should be deleted with the (0-255)

N: long - the number to delete key bytes

Result: Long - 0

Example (describes a 200,000-byte field with the byte value 128):

ClearWith (area #, 0,128,200000)

CloneFX

CloneFX (H)

Creates a copy of one of

PngToFX (), InitFX () or CreateFX () generated byte arrays.The structure is

copied, as well as the actual image in the array.

H: Long - one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays

Result: Long - Handle of the generated byte arrays.

The handle of the array must be copied later, as usual, with

FreeFX () will be released! Collide

Collide (H1, H2)

Tests whether just two sprites collide.

H1: Long - Sprite 1, first with the handle of a InitSprite () generated sprites

H2: Long - Sprite 2, second one with a handle InitSprite () generated sprites

Result: Long - Status of the collision or in error 0

For result, there are these two possibilities:

0 = no collision takes place the moment these two sprites or there has been a failure

1 = two sprites are just touching

This function does not work with pixel, but checks whether the areas) (width x height of the sprites are

. touch That she is working at lightning speed. But if they need a pixel-perfect collision routine, then

they take better

Collision ().

x & = Collide (sprite1 &, & sprite2)

CollideAll

CollideAll (H)

Tests whether the sprite collides with the handle H with any other sprite.

H: Long - one with a handle InitSprite () generated sprites

Result: long - 0 or handle of the sprite first found that just collided.

This function does not work with pixel, but it is a quick way to an almost complete

Collision detection. More detail (and is) just as fast

CollideUnknown ().

Does not times 1 millisecond to hundreds of sprites ...

Very useful with the functions

Mark to use sprite ().

x & = CollideAll (& sprite)

CollideMore

CollideMore (H, B, D)

Tests whether the sprite with the handle H collision with other sprites straight.

H: Long - Handle with a generated InitSprite () sprites.

B: Long - range variable in a list of sprite handles (Longs) stands.

A: Long - the number of Sprite handles that are in Area B.

Result: Long - 0, on error or no collision, otherwise handle Sprite First encountered in the area B, which is currently colliding with H

This function works very fast, but not with pixel accuracy. That may now many sprites on a

Collision be tested without the profane would have a slow loop to be used for this purpose.

Example:

VarToLong4 (area #, 0, & sprite1, sprite2 &, & sprite3, sprite4 &)

VarToLong4 (area # 16 & sprite5, sprite6 &, & sprite7, sprite8 &)

VarToLong4 (area #, 32, sprite9 Leave &, & sprite10, 0.0) '10 Sprite handle in the field

x & = CollideMore (& sprite, area #, test 10) 'whether sprite0 & with one of these

Sprite collides. CollideUnknown

CollideUnknown (B)

Identified in one go, all (!) Sprite to sprite collision that takes place at the moment!

B: long - pointer to an area that can absorb the collision data

Results: Long - the number of found Sprite collisions.

Long demanded, and now it finally is! A complete solution for all sprite collisions, the straight

. held

CollideUnknown () works within a millisecond, and lists all conflicts in the region B.

Together with

Mark Sprite () can be classified as all the sprites useful and fast.

Two each sprite handle (yes, a collision takes two sprites) are as LongInt

write a row in the range B.

Offset significance

0 1. Handle by Sprite Collision 1

4 2. Handle by Sprite Collision 1

8 1. Handle by Sprite Collision 2

12 2. Handle by Sprite Collision 2

16 1. Handle by Sprite Collision 3

20 2. Handle by Sprite Collision 3

...

Small sample program to evaluate these collisions:

Clear Kollis #

x & = CollideUnknown (# parcels)

If x &

& y = 0

Whileloop x &

a & = Long (parcels #, y &)

b & = Long (parcels #, y & +4)

Print "No Collision" + Str $ (x &)

Print "1 = sprite handle," + Str $ (A &)

Print "Sprite Handle 2 =" + Str $ (b &)

'*** This could now according to certain collisions

'*** To respond (forVia Mark B. Sprite)

y = y & & +8

Wend

EndIf

It should be mentioned, are filtered out of the double collision ProSpeed already, that is

Thus, the present two of the same handle twice in different order.

That does not mean that prejudice, if more than two sprites, they are not listed!

Here's an example - adopted there were three sprites and sprite, all three would be another

. touch Then the content of B would look like this:

0 Handle by Sprite 1 \

) - Collision 1

4 Handle by Sprite 2 /

8 Handle by Sprite 1 \

) - Collision 2

12 Handle by Sprite 3 /

16 Handle by Sprite 2 \

) - Collision 3

20 Handle by Sprite 3 /

CollideUnknown () returns in this case a value of 3 (three collisions).

Collision

Collision (H1, H2, X, Y)

Tests whether just two sprites collide.

H1: Long - Sprite 1, first one with a handle InitSprite () generated sprites

H2: long - Sprite 2, second one with a handle InitSprite () generated sprites

X: How long - X size of the pixel sampling

Y: Long - Y extending the pixel sampling

Result: Long - Status of the collision or in error 0

For this result, there are two possibilities:

0 = no collision takes place at the moment these two sprites or there has been a failure

1 = two sprites are just touching

This feature has been completely rebuilt for ProSpeed V2.1 and is now working with other technology. Two

Parameters have been added to herabzusetzten the duration of this function. So far Collision () was very

slowly, which lay on the scan and pixel-perfect, with 0 / 0 in the parameters X and Y is the function

still just as slow.

X and Y say they are number of pixels in the sensing Collisions always skipped, so must

far fewer pixels are examined. A call to Collision (sprite1 &, & sprite2, 4.4) forB. goes very fast

, and is still very safe in the collision detection. To the best values for their two sprites

to figure out they should just play around a bit.

A restriction on certain video modes are now available for Collision anymore.

x & = Collision (sprite1 &, sprite2 &, 4,4)

Colorfill

Colorfill (A, F)

Colors, an effect byte-array in a particular color.

A: Long - one with a goal-Handle

PngToFX (), InitFX () or CreateFX () generated

Byte arrays

Q: Long - RGB color value

Paint a very simple function is a ByteArray quickly.

Colorfill (array &, RGB (126,34,220))

ColorFillImage

ColorFillImage (V, R, X1, Y1, X2, Y2)

Fill a rectangular area of a bitmap with color in V R.

V: Long - HDC

R: Long - RGB color value.

X1: Long - Left offset, in pixels, in which begins the filling.

Y1: Long - Upper offset in pixel on which begins the filling.

X2: Long - Right-hand offset in pixel, of termination of the filling.

Y2: Long - lower offset in pixels, of termination of the filling.

Score: 0

Example:

ColorFillImage (HDC &, RGB (255,0,0), 0,0,% maxx, maxy%) 'Fills the HDC completely red.

Sometimes you must have a HDC fill with a specific color. This is now without a lot of

Expenditure. But ColorFillImage () is still so flexible that even an arbitrary

rectangular area can be filled.

ColorMove

ColorMove (F, X, Y, B1, B2, S)

Mixes two different images into one, unlike

SEMITRANS () are not two pictures

transparent mixed, but it will only approximate the colors of both images. This function is

much faster than SEMITRANS (), and it can be displayed with a trick images

Not only are rectangular, sprites, for, for example,

Q: Long - Handle of the target bitmap (HDC) or 0

X: Long - X offset to screen

Y: long - Y offset to the screen

B1: Long - First one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (1. source bitmap)

B2: long - produced with the handle of a second PngToFX (), InitFX () or CreateFX () byte array (2. source bitmap)

S: long - step of alignment.

Result: Long - 0

The colors of the graphic with the increment S B2 are increasingly closer to the colors of the graph B1.

The byte data of B2 are changed by this. If it the background along with an image

want to combine, they must work with a corresponding copy of the background, which for

B1 or B2 is used.

X and Y specify the upper left corner where they have placed both images. The size of the display

Rectangle is derived from the size of the bitmap that is specified in InitFX () / CreateFX (). The size

of B1 and B2, but must always be the same size!

For F one of profane can either be specified or a bitmap, with LoadFileImage () /

CreateImage () was created. Is passed, however, for F 0, the function will be executed but

not brought to the screen.

ColorMove () and is super fast, but uses an 400 MHz computer, even with large screens

in real time. Generally applies: The smaller the area, the faster this function works.

Before the function can be used, must be a preparation with InitFX () have taken place.

The data in the byte array B1 are not changed by calling this function already from B2.

The larger the step size S is, the faster it will appear. Here, values are from 1-255.

Example:

A sprite appears quite soft in the existing background image.

fxhandle1 & CreateExtImage = (% hdc, 80.80) 'Handle 1: Creating empty bitmap

Paint Image (fxhandle1 &, 0,0,80,80,% HDC, 0,0,0) 'Content of the Profanfensters to handle 1

$ name = "picture.bmp"

fxhandle2 & LoadFileImage = (addr ($ name)) 'Handle 2: Sprite invite suchB. 80x80 size

Paint Image (fxhandle1 &, 0,0,80,80, fxhandle2 &, 0,0, -1) 'in the Sprite

transparent mode after copying handle 1 '

Paint Image (fxhandle2 &, 0,0,80,80,% HDC, 0,0,0) 'Content of the Profanfensters to Handle 2

bytearray1 & = generate InitFX (fxhandle1 &) 'byte array to handle 1

bytearray2 & = generate InitFX (fxhandle2 &) 'byte array to Handle 2

WhileLoop 256

ColorMove (% HDC, 0.0, & bytearray1, bytearray2 &, 1) 'The sprite is displayed in 256 steps in the' background image

Wend

FreeFX (bytearray1 &) 'byte array 1 unlock

FreeFX (bytearray2 &) 'byte array 2 unlock

FreeImage (fxhandle1 &) 'Handle 1 unlock

FreeImage (fxhandle2 &) 'Handle 2 unlock

CompareBytes

CompareBytes (B1, B2, A, D)

A compares the two bytes of memory areas B1 and B2 for equality and Discrepancies.

B1: Long - 1 area variable

B2: Long - range variable 2

A: Long - Number of bytes to be reviewed

T: Long - tolerance for each byte comparison

Result: Long - 0 for complete compliance, otherwise number of different bytes.

Often a necessary function, especially suitable to compare texts or bitmaps, and as always very fast.

T will normally be zero. You can also specify a tolerance with. If the two bytes of

the two areas are compared, and the difference between the two is not larger than the

Tolerance value, then the comparison is positive, the two byte values can therefore be considered equal. At

Tolerant of 10 for aAs were the two numbers 201 and 208 than it was rated the same.

Examples:

(1. Compares 80,000 bytes of data from two areas, with no tolerance)

(2. Compares two images (jpg and bmp, the same motif with one another), 4 x with different tolerances (0, 10, 50, 100)).

x & = CompareBytes (area1 # Range2 #, 80000.0) 'Example 1

Print "number of different bytes:" + Str $ (x &)

$ text = 'Picture' example 2

LoadFileImage & pic1 = (addr ($ text))

$ text = "Picture.jpg"

LoadFileImage & pic2 = (addr ($ text))

array1 = InitFX & (& pic1)

array2 = & InitFX (pic2 &)

bytes & = Long (& array1, 20), size of the images in bytes (both) is equal

x & = Long (& array1, 40); pointer to byte array of picture 1

y & = Long (& array2, 40); pointer to byte array of picture 2

CompareBytes = z & (x & y &, & bytes, 0)

Print "number of different color pixels (of" + Str $ (bytes &)+"): "+ Str $ (z &)

CompareBytes = z & (x & y &, & bytes, 10)

Print "Number of different color pixels (of" + Str $ (bytes &)+"): "+ Str $ (z &)

CompareBytes & z = (x & y &, & bytes, 50)

Print "number of different color pixels (of" + Str $ (bytes &)+"): "+ Str $ (z &)

CompareBytes & z = (x & y &, & bytes, 100)

Print "number of different color pixels (of" + Str $ (bytes &)+"): "+ Str $ (z &)

FreeFX (array1 &)

FreeFX (& array2)

FreeImage (pic1 &)

FreeImage (pic2 &)

Compute

Compute (B, A, F ,+,-,*,/, S)

Applying simple arithmetic operations on all or some of the long integer (optional integer or bytes) in one area.

B: Long - range variable (memory address)

A. Long - Number of bytes in B, which will be re-calculated with Compute ()

Q: Long - flag, which number system is used: 1 = byte / 2 = Integer / 4 = LongInt

+: Long - This value is added to each number in the field

-: Long - This value is subtracted to each digit in the range

*: Long - This value is multiplied by every number in the range

/: Long - Each number in the field is divided with this value (decimal digits are truncated)

S: Long - After each number as many bytes skip, usually 0

Results: Long - 0

With Compute () lot numbers can simultaneously adds, subtracts, multiplies, and / or be divided.

This can be set (for F), whether the numbers in the range B bytes, integers or LongInt's supposed to be. A 1

ie, all numbers are treated as bytes. At 2, all numbers are treated as an integer, as LongInteger at 4.

In S can be specified whether each number in the field should be recalculated after each number, or whether

a certain number of bytes to be skipped.

+, -, * And / can all be used simultaneously or individually, or otherwise combined, the

Order, with all four should be expected, is always Multiply: - subtract divide - add -.

If it is determined in F, will use the byte or integer (1 or 2), must be noted that

Secular bytes and always as an unsigned integer in areas, handle only with positive numbers

calculated. Negative numbers so obtained therefore incorrect values. At long integer that is not as if they are

always signed deals with negative numbers, and also provide a correct result.

Bytes only within the numbers 0 to - operate 255, integer numbers in the 0 - 65535th Long

Integer can expect numbers from -2,147,483,648 to 2,147,483,647.

Example 1:

$ text = "10,20,30,40"

SetBytes (area #, 0, addr ($ text))

Compute (area #, # 4,1,0,0,0,10,0) 'Results of the first four bytes in the field: 1, 2, 3, 4 (all bytes / 10)

Example 2:

$ text = "10,20,30,40"

SetWords (area #, 0, addr ($ text))

Compute (domain # # 8,2,0,0,10,0,0) 'Results of the first four integers in the field: 100, 200, 300, 400 (all integer * 10)

Example 3:

$ text = "10,20,30,40"

SetLongs (area #, 0, addr ($ text))

Compute (area #, # 16,4,11,22,0,0,0) 'Results of the first four LongInt Area: -1, 9, 19, 29 (all LongInt + 11 to 22)

Example 4:

$ text = "10,10,20,20,30,30,40,40"

Clear area #

SetLongs (area #, 0, addr ($ text))

Compute (area #, # 32,4,0,0,123,321,4) 'Results of the first eight LongInt Area: 3, 10, 7, 20, 11, 30, 15, 40

'(every second LongInt * 123 / 321)

CopyFX

CopyFX (F, X, Y, B)

Manually copy of a byte array to the on-screen (or portions thereof).

Q: Long - Handle of the target bitmap (HDC) generated)

X: Long - X Offset in F

Y: Long - Y offset in F

B: Long - one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (source bitmap)

Result: Long - 0

= array & InitFX (exhdc &) 'Handle (byte array) to create a bitmap

FlipX (% HDC, 0.0, array &)

FreeFX (array &) 'later release

does the same as ...

= array & InitFX (exhdc &)

FlipX (0,0,0, array &)

CopyFX (% HDC, 0.0, array &)

FreeFX (array &)

CopyMemory

CopyMemory (Q, A1, Z, A2, B)

Copies the contents of a memory block to another location somewhere in memory.

The command works from left to right,. It should only be used as long as no overlap

occurs between source and target range.

Q: Long - the source address (egB. range variable)

A1: Long - Offset to the source address

Z: Long - target address (egB. range variable)

A2: Long - offset to the destination address

B: Long - Number of bytes that should be copied

Results: Long - 0

Examples:

CopyMemory (Table 1 #, 0, Table2 #, 0.10000)

CopyMemory (Table1 #, 4000, Table1 # 3000.1000)

Execution time, 40000 bytes:

Original Secular = 4850 milliseconds (with copy WhileLoop-loop)

ProSpeed.dll = <1 millisecond

CopyMemoryFromBack

CopyMemoryFromBack (Q, A1, Z, A2, B)

Functional description, see

CopyMemory.

Both commands have an equivalent effect, and syntax working internally but different.

CopyMemoryFromBack works from right to left. This method can also overlap

be the source of the area and target area properly copied.

CopyMemory CopyMemoryFromBack are equal and fast in their execution.

First, an example of CopyMemory:

CopyMemory (Table #, 0, Table #, 1.8)

8 bytes will be shifted within a range of 1 byte to the right. The bytes are

copied from left to right. CopyMemory is wrong here, but write values.

------------------------

»

From this sequence of bytes 0 -> 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 9 10 11 ...

is 0 0 0 0 0 0 0 0 0 9 10 11 ...

Byte 0 is copied to byte 1, then byte 1 (now the value of byte 0 will have) copied to bytes 2,

Byte 2 to byte 3, etc.

Now the same command CopyMemoryFromBack as:

CopyMemoryFromBack (table #, 0, table 1.8)

This time, however, the memory area is copied from right to left.

"

------------------------

From this sequence of bytes 0 -> 1 -> 2 -> 3 -> 4 - Over 5 -> 6 -> 7 -> 8 9 ... 10 11

will be 0 0 1 2 3 4 5 6 7 9 10 11 ...

Byte 7 byte is copied to 8, then byte 6 to byte 7, byte 6 to byte 5, etc.

CopyMemoryFromBack so it works correctly.

The other way around would work at the command of the command correctly and CopyMemory

CopyMemoryFromBack would write incorrect values in the memory:

CopyMemory (Table # 1, Table 0.8)

8 bytes this time should be moved within a range of 1 byte to the left.

CopySprite

CopySprite (H)

Copy the sprite with the handle H with identical values.

H: Long - one with a handle

InitSprite () generated sprites

Result: Long - on error 0, otherwise handle the new sprites

This function makes a sprite two.

Example:

new & (= old & CopySprite)

CountAllSprites

CountAllSprites ()

Counts how many tables exist Sprite. Counting all the sprites so far are also deleted!

Result: Long - Number Sprite Tables

Count bytes

Count bytes (V, A, N, B)

Testing a part of an area (or all) to a specified byte, and reports how many bytes in

the area occurs.

V: range variable

A: Long - Offset Address

N: Long - Number crawler bytes

B: Long - to look up Byte

Results: Long - Number of bytes found

Example:

(Tests, how many times the byte 128 in a 40,000-byte field.

& # x = range (Count bytes, 0,40000,128)

Print "Number of bytes =" + Str $ (x &)

Number of bytes = 5867

First count bytes

First count bytes (V, A, N, B)

Testing a part of an area (or all) to a specified byte, and reports how many bytes

occurs first in the area until another byte is found. Useful forFor example, to identify,

How many spaces initially appear in a string before the regular text is reached.

V: range variable

A: Long - Offset Address

N: Long - Number crawler bytes

B: Long - to look up Byte

Results: Long - position at which occurs a different byte than B

Example:

'Code expires Secular 7, have to work with Profanversionen previous range variables ...

$ string = "Hello"

x & count = First Bytes (Addr (string), 0, Len (string), 32) 'Chr $ (32) = blanks

Print "Number of leading spaces:" + Str $ (x &)

Number of leading spaces: 12

Count joystick buttons

Count joystick buttons (N)

Determines the number buttons, and available on the attached joystick N.

N: Long - the number of joysticks, 1 or 2

Result: Long - the number of available joystick buttons in error 0

x & count = joystick buttons (1)

Long Count

Long Count (V, A, N, L)

Testing a part of an area (or all) to a specific longword (long) and reports how

often the longword in the area occurs.

Please note that in an area of suchDimensioned as with 10000, was only 2500 Longs

may occur (1 Long = 4 bytes).

V: range variable

A: Long - Offset Address

N: Long - Number crawler-Long Words

L: Long - to look up longword

Results: Long - Long Number of found Words

Example (Secular 7):

(Tests, how many times the LongInt 178,064 in 40,000-byte field.

& # x = range (Count bytes 0,10000,178064)

Print "number of integer =" + Str $ (x &)

Number of Integer = 47

Count sprites

Count sprites ()

Counts how many sprites are redrawn are currently / running.

Result: Long - Number of sprites

Count strings

Count strings (V, A, N, S, L)

Testing a part of an area (or all) on the contents of a string and report how often the

String in the field occurs.

V: range variable

A: Long - Offset Address

N: Long - Number crawler-byte (length of the area, the ground is searched)

S: string (or area) that contains the search string

L: Long - Length of the search string in bytes

Results: Long - the number of found strings

Example (Secular 7):

(Tests, as often happens, the string "Hello" in a 80,000-byte field.

$ text = "Hello"

x & count = string (domain #, 0.80000, addr ($ text), Len (text $))

Print Chr $ (34) + text $ + Chr $ (34) + "was" + Str $ (x &) + "x in the area before."

"Hello" x 61 came before in the area.

CountWords

CountWords (V, A, N, W)

Testing a part of an area (or all) on a particular word and report how often the Word

occurs in the area.

Please note that in an area of suchDimensioned as with 10000, was only 5,000 Words

may occur (1 Word = 2 bytes).

V: range variable

A: Long - Offset Address

N: Long - Number crawler Words

W: Long - to look up word

Results: Long - Number of found Words

Example (Secular 7):

(Tests, how often the Integer / Word 4064 appears in a 40,000-byte field.

& # x = range (Count bytes 0,20000,4064)

Print "Number Integer =" + Str $ (x &)

Number of Integer = 644

AddWindowStyle

AddWindowStyle (W, S, F)

(To enable one or more) Windows Extended Window flags and flags, and thus changes the appearance

a window.

Watts: Long - Handle of a window, or (forB. HWnd%) or a control (for, for example,

Box)

S: Long - level (s) for Window Style (s), or Extended Window Style (s)

Q: Long - flag, which style is used: 0 = Window-Style / 1 = Extended

Window Style

Score: 0

This looks like a window can be changed, which is already open. AddWindowStyle () adds

this, the specified Style with S added. This can have a combination of multiple window

His styles. However, the standard Windows styles may not with the extended window styles

be combined! If they want more one (or) extended window style (s) to add, then

must be specified for F is 1, for standard Windows styles a 0

Examples:

(1. Adds Profanfenster a horizontal and vertical scroller added)

CreateFX

CreateFX (B, H)

Creates a byte array structure manually.

B: Long - Width of the imaginary image

H: Long - the amount of the imaginary image

Result: Long - Handle a byte array structure, in error 0

A byte-array structure is created. The graphic data (pixel data), so the actual byte array) is filled with 0 values (black image.

For further explanations under

) InitFX (.See also PngToFX ().

CreateFX (1024.768)

CreateImage

CreateImage (V, W, H)

Creates an empty bitmap.

V: Long - Secular variable% HDC

B: Long - Width of the new bitmap

H: Long - the amount of the new bitmap

Results: Long - Held handle of a memory device context (in-memory image data structure, HDC).

On failure 0

Example:

ExternHDC & CreateImage = (% HDC, 100.40) 'Creates an empty, 100 x 40 pixel bitmap' in memory

The bitmap will be held so long in the memory until it through

FreeImage () is again discharged.This should

no later than the end of the program carried out in order to provide the resources free again.

Currently can be simultaneously held in memory up to 32 external bitmaps, nor to whom the

bit is the sign for me please.

This function should only be called when the profane has already opened a window.

Crypt

Crypt (B, A, S, L)

Encrypted data in an area with a password of any length. In the same call twice

are the original data restored.

B: long - a range variable that stores the data

A: long - number of bytes to encrypt

S: Long - pointer) on a string (or area that is stored in the password

L: Long - length of the password

Result: Long - 0

A super-fast and relatively secure data encryption to password-based XOR.

Example:

$ name = "Datenfile.dat"

x & = (FileSize $ name)

ReadFileFast (addr ($ name), area #, 0, invite x &) 'file / data in a range variable

$ password = "CryptMe" 'password' is CryptMe "

Crypt encrypt (area #, & x, addr ($ password), len ($ password)) 'Data from the field

$ name = "Datenfile_crypted.dat" 'This could be the encrypted file back

WriteFileFast (addr ($ name), area #, 0, & stored x) '...

Crypt (area #, will & x, addr ($ password), len ($ password)) '... or returned to its original condition'

Curve

Curve (H, SX, SY, CX, CY, EX, EY)

Draws a curve in the bitmap of any HDC's.

H: Long - HDC

SX: long - starting point, X-axis

SY: Long - the starting point, Y-axis

CX: Long - Control Point (center), X-axis

CY: Long - Control Point (center) Y-Axis

EX: Long - end-point, X-axis

EY: Long - end-point, Y-axis

Result: 0

A function to draw an arbitrary curve. The color of the curve with the usual

Graphics commands set. From the starting point of the curve is the control point is up to this

Rounded point and then continues to the end point. H can be any HDC, HDC also%.

Curve (% hdc, 50,50,400,300,100,200)

Darken

Darken (F, X, Y, B, S)

Darkening of the screen (or portions thereof) to a black surface.

Q: Long - Handle of the target bitmap (HDC) or 0

X: Long - X offset to the screen

Y: Long - Y offset to the screen

B: Long - one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (source bitmap)

S: Long - step of darkening

Result: Long - 0

The screen is obscured by S stages. S may here from 1 to 255th The current graphics mode is

for this function does not matter. Intern is expected with 24 bits.

X and Y specify the upper left corner, is obscured from the on-screen. The size of the

blackout zone results from the magnitude of the bitmap that is specified in InitFX () / CreateFX ().

For F one of profane can either be specified or a bitmap, with LoadFileImage () /

CreateImage () was created. If passed, but for R 0, the function will be executed but

not brought to the screen.

Darken () is pretty fast and works in real time. Larger screens (egB. 1024x768) should be based on

slow computers, but not in 1-step increments shall be darkened. From a 600 processor should

But the speed of this range.

Generally, the smaller the area, the faster it darkens.

Before Darken () can be used, must be a InitFX preparation with () have taken place.

The data in the byte array B are changed by calling this function ..

Example:

A screen will gradually darken:

= array & InitFX (exhdc &) 'Handle (byte array) to create a bitmap

WhileLoop 256

     Darken (% HDC, 0,0, & array, 1)

EndWhile

FreeFX (array &) 'later release

Data Bytes

Data Bytes (S)

An implementation of the Basic DATA command for the profane. "Data Bytes ()" is also available as a procedure "Data".

S: Address of a string with input instructions

Results: Long - 0

Secular does not know the DATA command. Practically, however, it would be a feature to a memory area

Assign (range) data.

ProSpeed does this have long

SetBytes () available.Data bytes / data, however, goes

one step further.

First, is determined by Datames (), should have access to what area of data bytes / data next.

Datames () sets this automatically positioning on the first byte of the target area (

DataPos (0)):

Datames (domain #)

Data 250,128,23,56,251,83,90,12,7,252,253,0,26,124,78,78,43,202 "

Data 1,254,59,255,77,200,201,45,202,203,204,205,206,207,56,23,78 "

Data "228.23"

Datames (memory #)

Data 206,56,23,78 "

Data 250,124,78,78 "

Data 77,200,201,45 "

(This source code uses the procedure "Data". If they file in their program

ProSpeed_Funktionen.inc

integrated, they can access it from profane 7.)

With this source would be the first 37 bytes of the area described area # ", then the first

12 bytes of the area "stored #".

Data Bytes () / data can be used very well for images or other data directly into the

Source include (in order to incorporate more compact data, please use

Oembytes () / OEM).

The string S can contain only numbers, commas, spaces, and Zodiac, variables are not

allowed. ProSpeed converts this string into individual bytes and writes them into the area. The

Zodiac is a dummy character. More here at

SetBytes ().

In ProSpeed package contains a program

Data Generator (as a source and as an EXE), with the very

easily to any file in data lines can be converted. The so-generated lines can

be copied directly into the Secular-source, or as Inc-file are stored.

An illustrative example is the Data Generator Source itself. In any case reinschauen times.

Datames

Datames (B)

Sets a new area for data bytes (). The next data bytes () then takes over to this area from position 0.

B: New Area for the next data byte () to determine and byte offset set to 0

Results: Long - 0

More info, see

Data Bytes (). DataPos

DataPos (P)

Sets a new position for Data Bytes (). The next Data Bytes () then accesses from that position on the field.

P: Position (offset) of the next data bytes ()

Results: Long - 0

More info, see

Data Bytes (). DeInitPixelEffects

DeInitPixelEffects ()

Ends the pixel effects.

Result: Long - 0

DeInitPixelEffects () terminates the thread again, with

InitPixelEffects () was started.

Be done before the end of the program to release all the memory it has.

DeleteAllSprites

DeleteAllSprites ()

Removes all sprites from the screen.

Result: Long - 0

If at the end of a program are always used to make sure that all sprites

been deleted. Otherwise it when exiting the program come to a profane message.

DeleteAllXSprites

DeleteAllXSprites (X)

Removes all sprites from the screen, which are currently on-screen position X.

X: Long - display position in the X-axis

Result: Long - number of deleted sprites.

Can be very useful. Certain types of sprites can be deleted without knowing its sprite handle.

Sprites from the screen, etc. running

DeleteAllXSprites (-40)

DeleteAllYSprites

DeleteAllYSprites (Y)

Removes all sprites from the screen, which is currently underway to screen Y position.

Y: Long - Display position in the y-axis

Result: long - number of deleted sprites.

Can be very useful. Certain types of sprites can be erased without knowing its sprite handle.

Sprites from the screen, etc. running

DeleteAllYSprites (-40)

DeleteSprite

DeleteSprite (H)

Deletes the sprite with the handle H.

H: Long - one with a handle InitSprite () generated sprites

Result: long - 0

Deletes the sprite from the screen. H shall henceforth no longer be used.

DeleteSprite (& sprite)

DeleteSpritesIfAnimReady

DeleteSpritesIfAnimReady ()

Delete all completed sprites from the screen, the animation was in mode 1.

Result: Long - number of deleted sprites.

Very useful in connection with

SetSpriteAnimMode () and GetSpriteAnimModeStatus ().

Optimal for suchUsed as explosions, explosion sprite is removed when the animation has been run.

DeleteSpritesMark

DeleteSpritesMark (Z)

Removes all sprites from the screen, which were labeled with the number Z.

Z: Long - the number with which the sprite by

Mark Sprite () has been selected.

Result: Long - the number of deleted sprites.

Very useful in connection with

Mark Sprite () and GetSpriteMark ().

DeleteSpritesMark (111),

DeleteTags

DeleteTags (Q, A, Z, C1, C2, F)

Removed, or collect or store text passages that are located within two days mark.

Q: Long - pointer to a storage area (or string) with the source data

A: Long - Number of bytes to be processed in Q

Z: Long - pointer to a storage area (or string), be written in the target data

C1: Long - ANSI code of the start bytes

C2: long - ANSI code of Endbytes

Q: Long - Flags

Results: Long - Number of characters that were generated in Z.

Quite a versatile function, which can decrease the workload.

For example, could hereby Html tags are removed that are in angle brackets (<and>), or

Comments are deleted from source code ( 'and ANSI code 10), etc. Certainly there are still

all sorts of custom applications ...

Q and Z are pointers to memory or strings.

C1 and C2 can be values from 0 to 255, not higher! Both are ANSI code values. You should always

get different values.

Flags (F), there are now 2 (combined):

0 = no flag.

1 = Not the tags are removed, but everything else is removed, which

not between C1 and C2 (ie without tags are located).

2 = The tag characters C1 and C2 are the removal / collection not affected

The result is the number of characters / bytes that were generated in the target area Z. In addition, as is

End identifier inserted a null character!

For example, see Source

FA_DeleteTags.prf. DePack

DePack (Q, Z, P)

Decompressed (unzipped) a data area again, with

Pack () is compressed and / or encrypted.

Q: long - pointer to a source (or string pointer to an area) with the packed data.

Z: Long - pointer to the destination are stored in the extracted data

(Z = Q may not be, a second storage area is needed).

P: Long - pointer to a string / field that contains a password, or 0 (no password is used)

Result: Long - Number unpacked bytes. In Error = 0

The technology that lies behind DePack (), does not come from my pen. There is here the aPLib of

Joergen Ibsen uses a library that uses an LZ compressing technology, read more

below.

If they use the in ProSpeed.dll freeware program, it may DePack () / free aPLib

used, but in kommerizieller shareware programs and software they need aPLib

. Sign up

The aPLib license obtained for $ 29 (Company for $ 95) at Joergen Ibsen (

Website / Email).

Courtesy. aPLib, copyright © 1998-2002 by Jørgen Ibsen.

Data extracted again with

Pack () were packed

It is not necessary to specify the number of bytes packed somewhere, because this information into the packed

Data has been integrated.

To find out how many bytes the extracted data show later, must

GetOriginalSize () are used.

DePack () works very quickly.

Example (for loading, unpacking and decryption, also see example of pack ()):

$ text = "File Name"

(bytes FileSize = & $ text)

Dim range #, & bytes

ReadFileFast (addr ($ text), area #, 0, & bytes)

(neubytes & area = GetOriginalSize #)

Dim target area #, neubytes &

Print "compressed data =" + Str $ (& bytes) + "bytes."

Print "Calculated to extracting data =" + Str $ (neubytes &) + "bytes."

$ text = "password"

x & = DePack (area #, # target area, addr ($ text))

Print

Print "data = unpack" + Str $ (x &) + "bytes."

Compressed data = 5408 bytes.

Calculated, to decompress data = 48,030 bytes.

Data extracted = 48,030 bytes ..

DownloadHttpFile

DownloadHttpFile (U, D)

Downloads a file from the Internet onto your hard drive. See also

IsInternet ().

U: string (or area), which contains the name of the HTTP file

D: string (or area) that contains the filename of the file to be written

Result: Long - 0, 0 on failure " '

IfNot DownloadHttpFile ( "http://frabbing.de/bg.gif", "c: / test.txt")

Print "File has been generated."

Else

Print "Download failed!"

EndIf

DSoundDeInit

DSoundDeInit ()

Deinitializing DirectSound again and releases the memory. After this function DSound not allowed -

Function be called.

Result: Long - 0

DSoundGetInterfaces

DSoundGetInterfaces (S)

This feature makes ProSpeed's DirectSound functions compatible with King Sebastian DirectSound profane procedures.

S: Long - pointer to a variable that receives the interface pointer of the primary buffer.

Result: Long - IDirectSound interface pointer of the object.

Sebastian King DSInitFromProSpeed handler () uses DSoundGetInterfaces () to Dll and profane

Template to make them compatible. So they can combine both. Only for Professionals, and the ProSpeed

Sebastian's wish to combine templates.

Example:

IDirectSound & DSoundGetInterfaces = (Addr (DSBPrimary &))

DSoundGetNextBuffer

DSoundGetNextBuffer (A)

This function returns a single buffer from a buffer array.

A. Long - pointer to a buffer array, with

DSoundLoad () was created

Result: Long - pointer to the buffer, which will be played next with DSoundPlay ()

The result of this function is one of the 15 buffer from a buffer array, namely the buffers, as

Next with

DSoundPlay () is played.With this pointer, the volume or panning can be one

Sounds are altered before the sound is played.

Please note, the play buffer and a pointer to a storage area, whereas buffer and a pointer to a

Array storage areas is ...

play buffer & = (& buffer DSoundGetNextBuffer)

DSoundGetStatus

DSoundGetStatus (B)

This function determines the status of a sound game.

B: Long - pointer to a buffer, by

DSoundPlay () or DSoundGetNextBuffer () was passed.

Result: long - Status

The result returns the status.

If Bit 0 (value 1) set, the sound / buffer is playing, otherwise he is already finished.

If bit 2 (value 4) is set, then the sound as loop (infinite) is issued.

status & = (DSoundGetStatus buffer & play)

DSoundInit

DSoundInit (F)

Initialize DirectSound, a part of DirectX. So to use the functions of DSound ProSpeed.dll to

DirectX must be installed.

DSoundInit () must be called before using any DSound other features.

Q: long - Handle of the Secular window (hwnd%)

Result: Long - 0 = OK / not 0 = failure.

If DSoundInit () is called, must have a window (F) be open.

DSoundInit (hwnd%)

DSoundLoad

DSoundLoad (S)

Load a Wave file to play later.

P: long - pointer of a string with the name of a wave file

Result: Long - 0 = Error / else a pointer to a buffer array (important for

DSoundUnLoad ()).

A wav-file is loaded and stored in a buffer array.

Actually be in the buffer array created 15 copies of the sound, plus a counter. These 15

Copies of the same evidence, however, DirectSound internal memory, so that no memory is wasted.

Why 15 copies? Each copy can be played only once at a time. But 15 when we

Copies have, also can sound like 15 times one and will be played simultaneously, and that ought to

Every game rich, what we create ...

$ text = "test.wav"

buffer = & DSoundLoad (addr ($ text))

DSoundLoadMemory

DSoundLoadMemory (B, A)

Load a wave file from memory for later playback.

B: range variable

A: Long - Number of bytes in the field

Result: Long - 0 = Error / else a pointer to a buffer array (important for

DSoundUnLoad ()).

A wav file is loaded from a storage area and stored in a buffer array.

Actually be in the buffer array created 15 copies of the sound, plus a counter. These 15

Copies of internal evidence, however, the same DirectSound memory, so that no memory is wasted.

Why 15 copies? Each copy can be played only once at the same time. If we are but 15

Copies have also 15 times can sound like one and be played simultaneously, and that ought to

Every game rich, what we create ...

(This function has no extra-offset parameter, as in fact functions in many normal range.

Whether it is written now, a comma or a plus sign is eigenlich matter, as the following demo shows

which invites four samples from a storage area.)

buffer1 & = DSoundLoadMemory (area # 8200)

buffer2 & = DSoundLoadMemory (domain # +8200.16003)

buffer3 & = DSoundLoadMemory (domain # +24203.4004)

buffer4 & = DSoundLoadMemory (domain # +28207.22401)

DSoundLoadResource

DSoundLoadResource (H, S)

Load a wave file from a resource file for later playback. A resource file, a dll

his or Exeprogramm (forAs our own) that is linked together with data.

H: Long - hInstance a Exedatei or the handle from a loaded dll.

S: Long - the number of the resource or string with the name of the resource

Result: Long - 0 = Error / else a pointer to a buffer array (important for

DSoundUnLoad ()).

A wav file is loaded as a resource and stored in a buffer array.

Actually be in the buffer array created 15 copies of the sound, plus a counter. These 15

Copies of internal evidence, however, the same DirectSound memory, so that no memory is wasted.

Why 15 copies? Each copy can be played only once at the same time. But 15 when we

Copies have also 15 times can sound like one and be played simultaneously, and that ought to

Every game rich, what we create ...

For S is a number (long) or can a specify string (resource name). It can even be a number

be specified in the string, then the first character in the string must be a # and the rest is as a figure

interpreted, suchB. $ text = "# 100". S for a string is specified, then he must at least 3 characters

contain names with fewer characters are not allowed.

For H is a DLL or the hInstance of Exeprogramm can be specified, including a foreign

Exeprogramm, which contains resources that can be specified, if the hInstance of this program

was determined.

Note: Wave files in resources must be as resource type "WAVE" saved!

Examples:

1.)

DSoundInit (hwnd%)

dll & usedll = ( "Resource.dll")

$ text = "Sound1"

buffer1 & DSoundLoadResource = (dll &, addr ($ text))

2.)

buffer1 & DSoundLoadResource = (% hInstance, 100)

DSoundPlay

DSoundPlay (A, L)

This feature plays a sound that was loaded with DSoundLoad ().

A: Long - pointer to a buffer array, with

DSoundLoad () was created

Play L: Long - flag for loop () into a loop. 0 = no loop / 1 = Loop

Result: Long - pointer to the playing buffer.

The result of this function is one of the 15 buffer from a buffer array, namely the buffer, the

about to be played. This value can be queried by DSoundGetNextBuffer (), without

play the sound.

Please note, the play buffer and a pointer to a storage area, whereas buffer and a pointer to a

Array of storage areas is ...

play buffer = & DSoundPlay (& buffer, 0)

DSoundSetGlobalPan

DSoundSetGlobalPan (P)

This function changes the panning of all sounds the same.

P: Long - panning, -10000 = left / 10000 = far right.

Result: Long - 0

DSoundStop (5000)

DSoundSetGlobalVolume

DSoundSetGlobalVolume (V)

This function changes the volume of all sounds the same.

V: Long - volume, -10000 = very low / 0 = very loud.

Result: Long - 0

DSoundStop (-575)

DSoundSetPan

DSoundSetPan (B, P)

This function changes the panning of a sound.

W: Long - pointer to a buffer, by

DSoundPlay () or

DSoundGetNextBuffer ()

was passed.

P: Long - panning, -10000 = left / 10000 = far right.

Result: Long - 0

This function changes the panning of the sound in the buffer B. The values for P ranging from -10000 (quite

left) to 10000 (extreme right). A value of 0 stands) for a uniform distribution (in the middle.

DSoundSetPan (play & buffer, 5,000)

DSoundSetVolume

DSoundSetVolume (B, V)

This feature changes the loudness of a sound.

B: Long - pointer to a buffer, by

DSoundPlay () or

DSoundGetNextBuffer ()

was passed.

V: Long - volume, -10000 = softly / 0 = very loud.

Result: Long - 0

This function changes the volume of the sound in the buffer B. The values for V ranging from -10000 to 0

DSoundSetVolume (play & buffer, -575)

DSoundStop

DSoundStop (B)

This will stop a sound that is currently playing.

B: Long - pointer to a buffer, by

DSoundPlay () or

DSoundGetNextBuffer ()

was passed.

Result: Long - 0

DSoundStop (play & buffer)

DSoundUnLoad

DSoundUnLoad (A)

This function returns an array buffer clear again, that was created with DSoundLoad ().

A: Long - pointer to a buffer array, with

DSoundLoad () was created

Result: Long - 0

The copies of the sound and the sound itself be freed.

DSoundUnLoad (buffer &)

Create your own graphical effects

Create your own graphical effects:

Here is a description how to get a ByteArray - created with

InitFX () or CreateFX () - can manipulate yourself.

Thus, a byte array is nothing more than an image, but this is completely editable in memory.

But you should know exactly what to do, because an accidental fall into the wrong letter

Storage areas can cause considerable damage.

That is why I have spared me so far, include this information in the manual. But since lately

more and more users use the ProSpeed.dll not only profane but also himself Dll's Profile

or faster programming languages (suchB. PureBasic) use and ProSpeed's graphical effects

want to use, I have added this chapter added.

Secular itself is too slow to be able to properly own graphical effects.

InitFX () and CreateFX () pass a pointer. He points to an original Windows structure

(BITMAPINFOHEADER). This structure was, however, of ProSpeed a Long-Int (offset added 40).

Here are the offsets:

0 LONG biSize

4 LONG biWidth, width of the image

8 Long biHeight, height of the image

12 WORD biPlanes, always 1

14 WORDS biBitCount in ProSpeed byte array is always 24 (bit)

16 long biCompression always BI_RGB

20 Long biSizeImage, size of the byte array in bytes

24 Long biXPelsPerMeter

28 LONG biYPelsPerMeter

32 long biClrUsed

36 Long biClrImportant

40 Long pointer to the memory of the byte array

The values of the structure may Secular (accessed from 7) with @ Long ..

Most interesting, of course, to offset long-Int 40th Here are a pointer to the actual image data.

In earlier versions of the ProSpeed.dll graphic was turned on its head. From version 3.0 does not

more, and the bitmap into a byte array is stored from top left to bottom right.

3 bytes per pixel are required (24-bit), a blue value, a green value and a red value (in this

Order BGR, each one byte). If the width of the image is not smooth in the byte array is divisible by four,

adds additional padding bytes into Windows, a array of bytes that the manipulation of graphics data much

complicated and slowed by additional queries. So ask all the graphical effects of the

ProSpeed.dll an image whose width is smoothly divisible by four!

After you've manipulated the ByteArray, you can CopyFX with it () to bring to the screen.

Information for other programming

If irgenwo written by areas (area #), a vulgar memory area is meant as

for heAs with the API GlobalAlloc () can be generated. As a parameter must be a pointer to the

Storage area will be returned.

Examine

Examine (Z)

Determine if a string contains a number or text.

Z: Long - pointer to a string

Results: Long - 0 = number / 1 = text

(A string must end with a null character is always string of profane) is analyzed. Does the

String only contain the characters "

0123456789, .- ", then he is considered to be a number.

This method also works for negative numbers and decimals!

$ text = "-1234.56"

Examine (addr ($ text))

Color Exchange

Exchange Color (F, X, Y, B, Q, Z)

Swaps a color of an image (all pixels with that color) by a different color.

Q: Long - Handle of the target bitmap (HDC) or 0

X: Long - X offset to the screen

Y: Long - Y offset to the screen

B: Long - one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (source bitmap)

Q: Long - Source Color

Z: Long - Target Color

Result: Long - 0

B, all pixels in the byte array with the source color Q be recolored with color Z.

X and Y specify the upper-left corner of the graph B is copied to the recolour for F. The

Size of the new rectangle to be colored stems from the size of the bitmap in InitFX () / CreateFX ()

was specified.

For F one of profane can either be specified or a bitmap, with LoadFileImage () /

CreateImage ()

was created.If passed, but for R 0, then the recolour is executed but

not brought to the screen.

Color Exchange () is pretty fast and works in real time.

Before the function can be used, must be a preparation with

InitFX () have taken place.

The data in the byte array B are changed by calling this function ..

Example:

(a test image is loaded (with the yellow colors, red, blue, gray and white) and in the left pane

copied. Then four colors of the image are (yellow, red, blue and gray), colored purple and the other side

Pane copied.)

$ text = "test.bmp"

LoadFileImage hdc = & (addr ($ text))

Paint Image (% hdc, 0,0,444,356, hdc &, 0,0,0)

= array & InitFX (hDC &)

Exchange Color (0,0,0, & array, RGB (255,255,0), RGB (255,0,255)) 'yellow to

Color Exchange (0,0,0, & array, Rgb (255,0,0), RGB (255,0,255)) 'red to violet

Exchange Color (0,0,0, & array, Rgb (0,0,255), RGB (255,0,255)) 'blue to purple

Color Exchange (% hdc, 448.0, array &, RGB (153,153,153), RGB (255,0,255)) 'gray to

Violet and image copy to% hdc, X = 448, Y = 0

FreeFX (array &)

FreeImage (hdc &)

ExchangeRgb

ExchangeRgb (F, X, Y, A, R, G, B)

It strengthens or weakens from the color channels red, green and / or blue. A kind Lighten (), or

Darken (), and also used for individual color channels.

Q: Long - Handle of the target bitmap (HDC) or 0

X: Long - X offset to the screen

Y: Long - Y offset to the screen

A: Long - one with a handle

PngToFX (), InitFX () CreateFX or () produced Bytes

Ar rays (source bitmap)

R: Long - Gain (plus) or mitigation (minus) for the red channel

(Values from -255 to 255)

G: Long - gain (plus) or mitigation (minus) for the green color channel

(Values from -255 to 255)

B: Long - Gain (plus) or mitigation (minus) for the blue color channel

(Values from -255 to 255)

Result: Long - 0

The individual color components red, green and blue can do more with this feature or

be weakened.

X and Y specify the upper left corner, from which the effect will be brought to the screen. The size of the

Effect arises from the size of the bitmap that was specified in InitFX () / CreateFX ().

For F one of profane can either be specified or a bitmap, with LoadFileImage () /

CreateImage () was created. If passed, but for R 0, the function will be executed but

not brought to the screen.

R, G and B take values from -255 to 255. While minus values cause that this channel

abgeschächt is, and plus values, that the Kanl is strengthened. A zero means that this channel is not

changed. The farther the values of R, G and B is zero, the more visible the effect.

Before ExchangeRgb () can be applied must be a preparation with InitFX () have taken place.

The data in the byte array A will be changed by calling this function.

ExchangeRgb () replaced at bottom

Darken () and Lighten (), because these effects with the function very

can be easily simulated.

ExchangeRGB (0,0,0, array & strengthen, 1,0,0) 'red light

ExchangeRGB (0,0,0, & array, 0,0, -20) 'Blue considerably weaken

ExchangeRGB (0,0,0, dyeing & array, 255,255,255) 'Completely white

ExistSprite

ExistSprite (H)

Tests whether the sprite with the handle H still exists.

H: Long - one with a handle InitSprite () generated sprites

Result: Long - 0 = yes, still exists / -1 = no, the sprite has been deleted (Delete)

Because even some of the functions are automated, it can be to the times they want to know whether a sprite

still exists. They can learn herewith.

But even if they work by accident with a sprite handler, there is no longer (forExample, when

Use of CollideMore), the matter will then only have no effect. The internal structure remains Sprite

persist until the last sprite has been deleted or

CleanUp () was used, only

all structures shall be removed from memory.

ExistSprite (& sprite)

ExportPng

ExportPng (P, D, B, H)

Exported PNG files with 8/16-Bit-Alphakanal.

P: Long - pointer to a png handle created using

ImportPng () or PngToFX ()

D: string (or area), which contains the filename of the PNG file

B: long - width of the PNG image P

H: Long - the amount of the PNG image P

Results: Long - Number of bytes written to file D.

These

Function exports a PNG file from the png handle that was passed in P.F is a pointer

on a folder and file name to write the png image.

Since the Png handle only contains the actual data of the PNG image, additional information on the

Export needed: B and H are the dimensions of the image.

Example:

$ text = "name.png"

ImportPng & pnghandle = (addr ($ text), addr (& width), addr (& height), addr (number & bytes))

$ text = "neuername.png"

(count = bytes & & ExportPng pnghandle, addr ($ text), & width, & height)

External Bitmaps

External Bitmaps

FindBytes

FindBytes (B, O, A, S, L)

A copy of the Secular function MemPos, but has two Paramerter longer runs but starting from 5 and Secular

is about 100 times faster!

B: Long - range variable

O: Long - offset to the field

A: long - number of bytes in the crawler

P: Long - pointer to a search string (from Secular 7) or second range variable, suchB. Addr (string)

L: long - length of the string or the second area, suchB. Len (string)

Result: Long - Directory, or -1 if the string is not found.

With this function, any string can be searched in an area.

Example:

# string area, 700,000 describe = "Frank," 'the area with the bytes "Frank" here with 800,000 dimensioned

$ text = "Frank" 'Set the search string "Frank" Create

x & = (# FindBytes sector, 0.800000, Addr ($ text), Len (text $)) 'x & now shows 700,000 to

FindBytesCount

FindBytesCount (B, O, A, S, L, C)

An extension of the function

FindBytes ().Not addiction after the first occurrence of a string, but anywhere.

B: Long - range variable

O: Long - offset to the area

A: Long - Number of bytes in the crawler

S: Long - pointer to a search string (from Secular 7) or second range variable, suchB. Addr (string)

L: Long - length of the string or the second area, suchB. Len (string)

C: Long - the number of occurrences of S. Nullbasierend

Result: Long - Directory, or -1 if the string is not found.

With this function, any string can be searched in an area. This may

be specified, is meant by the reference number will.

For example, to find a specific line in a text file:

$ text = "Filename" 'Filename

(bytes = FileSize & text $) 'length of the file to determine (as an example, 48,030

Bytes)

Dim range #, & bytes' area dimensioned for file

ReadFileFast (addr ($ text), area #, 0, bytes Load &) 'File

text $ = Chr $ (13) 'search string (CR).

x & = FindBytesCount (area #, 0, & bytes, Addr (text search $), 1.146) 'Line 146

& +2 & x = x 'CR and LF skip

FindJoystick

FindJoystick (N)

Checks to see if a joystick (1 or 2) is present.

N: Long - the number of joysticks, 1 or 2

Result: Long - joystick 0 = absent / -1 = joystick does not exist or errors.

If it returns 0, this joystick is available. Upon return of -1 can not joystick this

be used. He is either not present or not (properly installed).

x & = FindJoystick (1)

FINDPATH

FINDPATH (B, BA, W, X1, Y1, X2, Y2, F)

This function finds a way into a pixel graphic (bitmap). Thanks to artificial intelligence is a relatively

found a short way, where black areas in the bitmap barriers and white areas walkable

Bodies labeled.

B: Long - pointer to a memory area (range variable), which has become operational later Wegdaten

BA: Long - pointer to a byte array (bitmap), which was created with InitFX ()

W: long - Wegbreite, we will search for a path of least W pixels wide / high (1 - ...)

X1: Long - X position within the bitmap, from which the search starts (starting point)

Y1: Long - Y position in the bitmap, from which the search starts (starting point)

X2: Long - X position within the bitmap, from where the search ends (target point)

Y2: Long - Y position within the bitmap, from where the search ends (target point)

Q: Long - Flags

Results: Long

-1 = An error has occurred (memory shortage)

0 = No path found

> 0 = number of bytes of Wegdaten generated in B. A value of

Zero was, therefore, the search was successful.

A new complex function to suchTo lead by example sprites labyrinth-like landscape

FINDPATH () works very fast and is also often complicated path within a millisecond.

Zuersteinmal function needs a mask bitmap with the available paths and obstacles. From

So must have a background of black with white image exist, in which black areas of Impediments

Stand (walls, etc.) and white surfaces for paths (vacancies).

This mask bitmap must then

Be InitFX () into a byte array (BA) transformed.With such a byte

FINDPATH array can work very quickly. And always remember, that the width as a byte array

Graphics always smooth must be divisible by four ...

When a way was found, writes FINDPATH () the Wegdaten in the storage area B.

Wegdaten are always integer values, for each coordinate point of the function writes an X-value and

a Y-value, ie 2 per waypoint integer (= 4 bytes). How many waypoints (coordinates pairs) are needed

to move from starting point to the target point lies in the length of the path and found the

Wegbreite (depending on the broad way, the farther apart the waypoints, the waypoints will be less needed).

B must be dimensioned large enough to accommodate all the waypoints to be. Unfortunately we can advance

not calculate how many bytes are needed. According to the formula, the maximum number of bytes can

are calculated, in practice it can never be achieved:

((Width of the bitmap * W) * (height of the bitmap * W)) * 64

I personally take this a memory with 200,000 bytes, which is enough for each navigation purposes.

W indicates the width (in pixels) a path must be at least so he will be found. Make way, however,

widening, which is in any particular case, more secure (in corners). They can also a flag in F

continued to make obstacles / walls in front of the artificially wide navigation purposes what the roads

course automatically makes narrow.

Reasonable values for W to go from 6 to 48 Values of 1-5 are too small and the execution of FINDPATH ()

take longer, values are greater than 48 for crude and the bitmap internally aufgepixelt too much.

In my tests, a value of 12 for W gave the best results. If a sprite by the way

be sent, it is the best value:

(Width + height of the sprite the sprite) / 2.

X1 and Y1 denote the starting point in the bitmap, X2 and Y2 the target point of the path search.

F stands for the flags, so far there are only two flags:

0 = Normal mode

1 = larger obstacles / walls artificially before the path search

Flag 1 has been introduced so, by a hair because the path search is often the way of obstacles

leads. When a sprite expires this way, it looks as though this clashed with the Sprite

Obstacles. Flag 1 widened invisible barriers (the picture is not altered in BA!) and

prevented this effect. Of course, this way / free space a little narrower, so they provide

sufficiently broad ways.

After a path has been calculated, it should not with

SmoothPath () are smoothed.

Example:

The sample code

FA_Wegsuche.prf shows very clearly that we programmed a path search.

x & = FINDPATH (area #, & array, 16,200,200,400,400,0)

FlipX

FlipX (F, X, Y, B)

Reflects a graphic in the X axis.

Q: Long - Handle of the target bitmap (HDC) or 0

X: Long - X offset to the screen

Y: Long - Y offset to the screen

B: Long - one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (source bitmap)

Result: Long - 0

The graphics of the screen is mirrored in the X-axis. X and Y enter the upper left corner of the

reflecting surface. The size of the rectangle resulting from the size of the bitmap in InitFX () /

CreateFX () was specified.

For F one of profane can either be specified or a bitmap, with LoadFileImage () /

CreateImage () was created. If passed, but for R 0, the function will be executed but

not brought to the screen.

Before the function can be used, must be a preparation with InitFX () have taken place.

The data in the byte array B are changed by calling this function ..

= array & InitFX (exhdc &) 'Handle (byte array) to create a bitmap

FlipX (% HDC, 0.0, array &)

FreeFX (array &) 'later release

FlipY

FlipY (F, X, Y, B)

Reflects a graphic in the Y-axis.

Q: Long - Handle of the target bitmap (HDC) or 0

X: Long - X offset to the screen

Y: Long - Y offset to the screen

B: Long - one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (source bitmap)

Result: Long - 0

The graphics of the screen is mirrored in the Y axis. X and Y enter the upper left corner of the

reflecting surface. The size of the rectangle resulting from the size of the bitmap in InitFX () /

CreateFX () was specified.

For F one of profane can either be specified or a bitmap, with LoadFileImage () /

CreateImage () was created. If passed, but for R 0, the function will be executed but

not brought to the screen.

Before the function can be used, must be a InitFX preparation with () have taken place.

The data in the byte array B are changed by calling this function ..

= array & InitFX (exhdc &) 'Handle (byte array) to create a bitmap

FlipY (% HDC, 0.0, array &)

FreeFX (array &) 'later release

Fog

Fog (F, X, Y, B1, B2, M)

A mist effect. Here are the passages through a mask bitmap defined within the image, the

affected by the fog effects are.

Q: Long - Handle of the target bitmap (HDC)

X: Long - X offset to the screen

Y: Long - Y offset to the screen

B1: Long - First one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (source bitmap)

B2: Long - one with a second handle PngToFX (), InitFX () or CreateFX () generated byte arrays (target bitmap)

M: Long - one with a handle PngToFX () InitFX () or CreateFX () generated byte arrays (mask bitmap)

Result: Long - 0

The graphics of images B1 and B2, taking into account the mask bitmap using a M

Fog effect for F and B2 combined.

X and Y specify the upper left corner where they have placed both images. The size of the display

Rectangle, it follows from the magnitude of the bitmap that is specified in InitFX () / CreateFX (). The size

of B1, B2 and M but must be the same size!

For F can be either one of the most profane bitmaps (% HDC% HDC2 ...) are specified, or one with

Produced LoadFileImage () / CreateImage () was. If F = 0, then the fog will be canceled on, but

not displayed.

The data in the byte arrays B1, M are not changed by calling Fog (), but already the data in B2.

The mask bitmap M should be a black and white image.

White pixels in the mask bitmap share Fog (), which will be produced in those areas of fog.

Black pixels in the mask bitmap mean, which is produced in those areas of the image no fog.

This function must be called under constant review in order to be properly visible mist effect

let.

Frame

Frame (W, H, L, X1, Y1, X2, Y2, W)

A function to a quick 3-D frame (characterized with variable stroke width) to.

B: Long - Handle of the HDC's, will be painted in the

H: Long - Hightlight Color (under bar on the left and above)

L: Long - Lowlight Color (under bar on the right and below)

X1: Long - coordinate of the left-hand corner

Y1: Long - coordinate of the upper corner

X2: Long - coordinate of the right-hand corner

Y2: Long - coordinate of the bottom corner

W: Long - Width of the frame in pixels

Results: Long - 0

This can easily be a 3-part set on a HDC.

For example, to draw a 4-pixel border to the profane main window, in the colors black and

White:

Frame (% HDC, Rgb (0,0,0), RGB (255,255,255), 30,40,100,200,4) 'into the main window

Frame (% HDC2, Rgb (0,0,0), RGB (255,255,255), 30,40,100,200,4) 'and once into secular backup

FreeAllImages

FreeAllImages ()

Unloads all the images from the memory, which means LoadFileImage () or

CreateImage () loaded / created

were and are the resources free again.

Results: Long - number of images that were released.

No later than the end of the program should be HDC's / pictures will be released. This happens

usually by

FreeImage (), but for safety and for convenience was still

FreeAllImages () to put that release in one go all images again.

FreeFX

FreeFX (B)

Release of memory that has been created with PngToFX (), InitFX () or CreateFX ().

B: Long - Handle one by

PngToFX (), InitFX () or CreateFX () generated byte arrays

Result: Long - 0

For further explanations under

InitFX (), PngToFX () and CreateFX ().

FreeFX (array &)

FreeImage

FreeImage (H)

Unloads an image from memory and the resources are free again.

H: Long - returns a

LoadFileImage () or CreateImage () n graph data structure (HDC)

Results: Long - one or greater, with error 0

.

Example:

FreeImage (exhdc &)

No later than the end of the program should be performed this function for any external graphic data structure to the

Resources reproduce freely.

FreePng

FreePng (P)

Are the resources of a PNGs free again.

P: Long - pointer to a png handle created using

ImportPng () or PngToFX () FxToPng

FxToPng (Q, B, H, A)

Created from one (or two) bytes array structure (s) (graphic effect) a Png handle (with 8-bit

Alpha channel).

Q: handle one with PngToFX (), InitFX () or CreateFX () generated byte arrays

B: Long - pointer to a Long, which is the width of the new PNG image takes

H: Long - pointer to a Long, which is the height of the new PNG image takes

A: Long - pointer to a long that receives the length of the new PNG image in bytes

M: 0, or one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays

Results: Long - Png handle in error 0

From version 3.0 supports the ProSpeed.dll png files with the widely used 8-bit alpha channel. To

these files to make them compatible with the graphical effects, there is this function.

Q is the handle of an array of bytes. B and H are the addresses of variables, the width and height of the

new PNG image to save. A is the address of a variable which stores the number of bytes that the

new image occupies in memory.

The function returns the handle of the newly created PNG image that for the other functions Png

is required. The alpha channel is filled for all pixels, so with the whole picture when viewing

PaintPng ()

completely visible.If M is not 0, then the image in M is used as an alpha channel mask.

Q and M must have the same case dimensions.

The returned handle is not compatible with handles of images, suchWith B.

LoadFileImage ()

have been identified! And he must be at least freiegegeben end of the program through

FreePng ().

Example:

$ text = "background.bmp"

hdc = & LoadFileImage (Addr ($ text))

$ text = "maske.bmp"

hdc2 & LoadFileImage = (Addr ($ text))

= array & InitFX (hDC &)

array2 = & InitFX (hdc2 &)

pnghandle (& = & FXToPng array, addr (& width), addr (& height), addr (number & bytes) & array2)

If pnghandle &

PaintPng (pnghandle &, number & bytes,% hdc, 0,0, & width, & height, 0)

FreePng (pnghandle &)

Endif

FreeFX (array &)

FreeFX (& array2)

FreeImage (hdc &)

FreeImage (hdc2 &)

GenerateChecksum

GenerateChecksum (B, A, S)

Generates a checksum from a byte of memory area B. The starting value for S may be a different value

be specified as zero.

B: Long - range variable

A: Long - Number of bytes that can be used for the checksum

S: Long - starting value of the check sum

Result: Long - checksum.

Checksums can be used very diverse. They are calculated very easily. Each byte of the

specified range of memory is added to the variables (S). This creates a very individual

Identifier for a memory.

Example (generates a checksum of 80,000 bytes of sector #):

GenerateChecksum (area #, 80000.0)

GetBackgroundInfos

GetBackgroundInfos (B)

Identified some important data about the background scrolling, which will be launched together with sprites

(may

InitSpriteBackground ()).

B: range variable

Result: Long - B.

The resulting data will be written as provided in the Longs area. This area must be at least 28 bytes long.

The following data is written into the area, here represented as an offset table.

0 = scroll mode, 0 scrolling = no / 1 = scroll

4 = set window width

8 = set window height

12 = X-offset to the beginning of the background image

16 = Y offset to the start of the background image

20 = X direction, scroll down to X pixels (can also be negative)

24 = Y direction, scroll down to Y pixels (can also be negative)

Example:

Dim range #, 28

GetBackgroundInfos (domain #)

x & = Long (range #, 8) 'Sample Query: Adjusted Window Height

If x &

...

EndIf

Dispose area #

GetHeightImage

GetHeightImage (H)

Determines the height of a bitmap, with

Loading LoadFileImage () or generated by CreateExtImage () was.

H: Long - Handle of the bitmap

Results: Long - Height of the bitmap (the picture in pixels), with error 0

.

Example:

$ text = "Picture.gif"

exhdc & Load LoadFileImage = (addr (text $)) 'external image into a bitmap

x & = GetHeightImage (exhdc &) 'determine the amount

Print "The amount of image Picture.bmp is" + Str $ (x &) 'and output with print

GetInfosImage

GetInfosImage (H, B)

Identified some information about a bitmap, with

Loading LoadFileImage () or generated by CreateExtImage () was.

H: Long - Handle of bitmap / the HDC's

B: long - pointer to a memory from which to receive the information) (40 bytes.

Results: Long - If everything glattging 1, with error 0

Example:

Dim range #, 44

GetInfosImage (HDC &, sector #)

Print "structure size =" + Str $ (Long (area #, unimportant 0)) '40,

Print "bitmap width =" + Str $ (Long (area #, 4))

Print "bitmap height =" + Str $ (Long (area #, 8))

Print "Number Plan =" + Str $ (Word (area # 12)) 'is always 1

Print "bit depth =" + Str $ (Word (area # 14))

Print "compression =" + Str $ (long (area # 16)) 'almost always BI_RGB

Print 'memory usage bitmap = "+ Str $ (Long (area # 20))' = header plus 54 bytes. Bmp Size

Print "XPelsPerMeter =" + Str $ (Long (area #, unimportant 24)) '

Print "YPelsPerMeter =" + Str $ (Long (area #, unimportant 28)) '

Print "ClrUsed =" + Str $ (Long (area # 32)) 'unimportant

Print "ClrImportant = '+ Str $ (Long (area # 36))' unimportant

GetOriginalSize

GetOriginalSize (Q)

Count the number of unpacked bytes are incurred when a pack with () is packaged storage area

unpacks.

Q: Long - pointer to a source (or string pointer to an area) with the packed data.

Result: Long - Number of unpacked bytes (original track). In Error = 0

This feature can only be applied to data with

Pack () been compressed.

It may be useful to find out how much memory for

DePack () must be reserved.

(bytes & = # GetOriginalSize area)

GetSpriteAnimModeStatus

GetSpriteAnimModeStatus (H)

Determine whether a sprite animation in the mode 1 is already reached at the end.

H: Long - one with a handle InitSprite () generated sprites

Result: Long - Status

0 = still running animation

1 = animation has been stopped

This function is only related to

To use SetSpriteAnimMode ().For more information, please refer them there.

x & = sprite (GetSpriteAnimModeStatus &)

If x = 1 &

...

Else if & x = 0

...

EndIf

GetSpriteFixMode

GetSpriteFixMode (H)

Gets the character mode for the sprite to the handle H, with

SetSpriteFixMode () has been set.

See also

VisualTableFix ().

H: Long - one with a handle InitSprite () generated sprites

Result: Long - Drawing mode: 0 = normal / 1 = as a still, non-animated sprite characterized

x & = sprite (GetSpriteFixMode &)

GetSpriteInfos

GetSpriteInfos (H, B)

Identified some important data for the sprite with the handle H.

H: Long - one with a handle InitSprite () generated sprites

B: range variable

Result: Long - 0 = error / instance otherwise

The data obtained are written as provided in the Longs area. This area must

least 32 bytes in size.

The following data is written into the area, here represented as an offset table.

0 = current X-position

4 = current Y position

8 = target position X (set by MoveSprite (), SetSpritePos ())

12 = Y target position (set by MoveSprite (), SetSpritePos ())

16 = sprite is already arrived at the target point (0 = no / 1 = yes)?

20 = set speed with which the sprite is moving on the x-axis.

24 = set speed with which the sprite is moving on the y-axis.

28 = current animation phase

Example:

Dim range #, 32

GetSpriteInfos (& sprite, sector #)

x & = Long (area # 16) 'sample query is: Sprite already arrived at the destination point?

If x &

...

EndIf

Dispose area #

GetSpriteLayer

GetSpriteLayer (H)

Gets the layer (presentation layer) of a sprite.

H: long - one with a handle InitSprite () generated sprites

Result: Long - the number of levels, with error -1.

Each sprite) has a different presentation layer (Layer. The lower it is, the earlier a sprite is

brought to the screen, so that it obscured by the subsequent sprites can be.

The layers ranging from 1 to number of sprites.

x & = GetSpriteLayer (& sprite)

GetSpriteMark

GetSpriteMark (H)

Determined the selection of the sprite with the handle H.

H: long - with handle of a InitSprite () generated sprites

Result: Long - the number has been marked with the sprite.

Determines the selection of one sprite, with

Mark Sprite () has been awarded.Thus sprite can use one

certain types of numbers are detected, very useful after a collision.

This can be determined that only certain sprites when a collision with suchReact as CollideAll () should.

x & = GetSpriteMark (& sprite)

GetSpriteMoveX

GetSpriteMoveX (H)

Tests whether the sprite is currently with the handle H is moving to the left or right.

H: Long - one with a handle InitSprite () generated sprites

Result: long - movement of the sprite on the x-axis

-1 = Sprite moves to the left

0 = sprite does not move to the left and not right

1 = sprite moves to the right

GetSpriteMoveX (& sprite)

GetSpriteMoveXY

GetSpriteMoveXY (H)

Tests moved in the direction that the sprite is currently with the handle H.

H: Long - one with a handle InitSprite () generated sprites

Result: Long - the direction of movement of the sprite.

0 = sprite stands still

1 = movement towards the upper right

2 = move right

Motion 3 = bottom right

4 = movement downwards

5 = movement to lower left

6 = Move left

7 = Move left top

8 = upward movement

GetSpriteMoveXY (& sprite)

GetSpriteMoveY

GetSpriteMoveY (H)

Tests whether the sprite is currently with the handle H is moving up or down.

H long - with handle of a InitSprite () generated sprites

Result: Long - movement of the sprite on the y-axis

-1 = Sprite moves up

0 = sprite does not move upwards and not downwards

1 = sprite moves down

GetSpriteMoveY (& sprite)

GetSpritesFps

GetSpritesFps ()

Determines the speed of the sprite thread in frames per second (fps).

Result: Long - Fps of the sprite thread

The returned value will be determined how many times per second, the newly drawn sprites.

GetSpriteX

GetSpriteX (H)

Retrieves the x position of the sprite with the handle H.

H: Long - one with a handle InitSprite () generated sprites

Result: Long - X position within the background image.

GetSpriteX (& sprite)

GetSpriteY

GetSpriteY (H)

Retrieves the Y position of the sprite with the handle H.

H: Long - one with a handle InitSprite () generated sprites

Result: Long - Y position within the background image.

GetSpriteY (& sprite)

GetSystemKey

GetSystemKey ()

Identified the key that was just pressed. This function works system wide and not only in

Secular window. Even the mouse buttons have to be consulted.

Result: ASCII code of pressed key. If no key is pressed, then -1.

GetVersion

GetVersion ()

Computes the present ProSpeed.dll version.

Result: Long - Latest Version Info

The result is always a four-digit number!

For example, output 2702, then this: Version 2.7 Release 0.2 does, so 2.7.0.2.

GetWidthImage

GetWidthImage (H)

Determines the width of a bitmap, with

Loading LoadFileImage () or generated by CreateExtImage () was.

H: Long - Handle of the bitmap

Results: Long - Width of the bitmap (the picture), in pixels, in error 0

.

Example:

$ text = "Picture.gif"

exhdc & Load LoadFileImage = (addr (text $)) 'external image into a bitmap

x & = GetWidthImage (exhdc &) 'latitude to determine

Print "The width of image Picture.bmp is" + Str $ (x &) 'and output with print

Graphic Effects

Graphic effects with external bitmaps:

Gray

Gray (F, X, Y, B)

Makes colorful screen (or smaller) gray. So Swaps all colors into shades of gray.

Q: Long - Handle of the target bitmap (HDC) production) or 0

X: Long - X offset to the screen

Y: Long - Y offset to the screen

B: Long - one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (source bitmap)

Result: Long - 0

The graphics of the screen is displayed in shades of gray. X and Y specify the upper left corner, from where the

Screen is changed. The size of the gray color rectangle resulting from the size of the bitmap,

the (in InitFX () / CreateFX) was specified.

For F one of profane can either be specified or a bitmap, with LoadFileImage () /

CreateImage () was created. If passed, but for R 0, the function will be executed but

not brought to the screen.

Gray () is pretty fast and works in real time. Generally applies: The smaller the area, the faster this function works.

Before the function can be used, must be a preparation with InitFX () have taken place.

The data in byte array B will be changed by calling this function.

Another word about the grays. Of these, there are more than 256 different

proper gray tones, namely, 0/0/0,

1/1/1, 2/2/2, ..., 254/254/254, 255/255/255. That needs to be considered.

= array & InitFX (exhdc &) 'Handle (byte array) to create a bitmap

Gray (% HDC, 0.0, array &)

FreeFX (array &) 'later release

HasSpriteArrived

HasSpriteArrived (H)

Tests whether the sprite has arrived with the handle H already at its target coordinates.

H: Long - one with a handle InitSprite () generated sprites

Result: Long - 0 = not arrived / 1 = reached the target point

If she a sprite with

Have MoveSprite () or SetSpritePos () sent to new coordinates, then

testing this feature if it's already arrived.

HasSpriteArrived (& sprite)

ImportPng

ImportPng (D, B, H, A)

Imported PNG files with 8/16-Bit-Alphakanal.

D: string (or area), which contains the filename of the PNG file

B: Long - pointer to a Long, which takes up the width of the loaded image

H: Long - pointer to a Long, which receives the amount of the loaded image

A: Long - pointer to a long that receives the size of the image in bytes

Results: Long - Png handle in error 0

.

Since version 2.5, the ProSpeed.dll can already load PNG files can also XProfan since version 11

But what did not go so far, were invited to display png's with transparent masks. It is

one of the great advantages of PNG that the images can contain transparency information.

The ProSpeed.dll here now supporting the widely used alpha channel 8

An alpha channel is an additional information that specifies for each pixel, how much of the background of

Image will show through. ProSpeed supports alpha channels of 8 and 16-bit, 256 levels of what

Transparency strength equivalent (16 bits internally counted down to 8 bit). Thus, it is now

possible, regardless of background, smoothing the edges of text and images. One can truly

Use drop shadows, hide in the background, or to generate images that arbitrarily shaped

are ...

Png's with the mask can not be loaded like other images. For this purpose, this function is necessary.

ImportPng () instead of the four required parameters:

D is a pointer to a folder and filename of the png image.

B and H are the addresses of variables to store the width and height of the imported image.

A is the address of a variable which stores the number of bytes occupied the picture.

The function returns the handle of the imported PNG image that for the other functions Png

is required. This handle is not compatible with handles of images, suchAs with LoadFileImage ()

have been identified! The handle must be at least freiegegeben end of the program through

FreePng ().

Regard! As with the graphical effects and the PNG should have pictures of latitude, which is smooth by 4

divisible!

Example:

$ text = "name.png"

ImportPng & pnghandle = (addr ($ text), addr (& width), addr (& height), addr (number & bytes))

Print & width, & height, number bytes &

Ntroduction

Version 3.0

Copyright 2004-2008 Frank Abbing

Author: Frank Abbing

Margarethenstr.13a

48683 Ahaus

Email:

mail@frabbing.de

Website:

http://frabbing.de

 

The ProSpeed package may be freely distributed and used, as long as no data of the program package

be altered or deleted. The Dll itself Inc and its files may, however, a different software

be included, provided that it needs.

The copyright of the dll, however, is always at its author. The ProSpeed.dll is freeware.

In any case, I am the author responsible for any special, incidental or indirect

Damage of any kind resulting from the delivery, performance or use of this software

. resulting

The ProSpeed.dll was written with great care, but I would not guarantee that it correctly

is. However, the software has been extensively tested, without the damage caused

You may not attempt to disassemble this software in whole or in part, to modify, translate,

disassemble, or, no single bit may be changed.

Description

A DLL for all programmers who still want to be (much) more out of their programming language.

The

ProSpeed.dll is very compact and written in pure assembler.

Topics of the DLL are sprites, image processing, image manipulation, PNG with alpha channel processing,

Storage areas, DirectSound, pixel effects, and general game programming.

The ProSpeed.dll is developed and tested under Windows XP and all functions were working at the tests

properly. If they still find a bug, or instructions to be faulty, it would be nice

when they communicated to me.

All of the examples are written in the profane and the profane should work from 7th Some examples also show

Lösungsmöglichenkeiten for old Profanversionen version 5 However, I recommend XProfan.

The examples chosen are simple and are likely to be quickly ported to other programming languages

can, forFor example, Visual Basic, etc.

From ProSpeed.dll version 1.3, there are specific sprite functions. You can create sprites, which

animated and moves automatically, without which the main program must still worry about it. The

Number of sprites is unlimited!

It almost reminds been of hardware sprites.

1

A dedicated scroll function ensures (in conjunction with the sprites) for a movement of the screen

Background (scrolling).

Another thing about the sprites. If they use it for the main program, there is often nothing

to do other than wait for a specific reaction of the sprite within a loop. In this

Case, they should in any event the Sleep command or API Sleep () to insert into the loop (forB. Sleep

2) to assign the DLL more computing power. The bescheunigt in many cases up to 100 percent.

As of version 2.7 have been several

Layer functions (to the representation to change more levels)

to put, that was called for a long time. Remains to be mentioned that at the first Sprite, which

created, the layer can never be altered / may.

Only that first generated sprite having such special status.

DirectSound is from 2.1 ProSpeed possible. Unlike the original wave files for playback functions

in the profane, they can now play as many waves at once, as they want. My special thanks go

here at King Sebastian (

http://www.sekoenig.de), the direct sound templates were a great help.

This makes possible a direct Secular DirectSound. Thanks Sebastian!

As of version 2.6 with Direct Sound Waves can be out even from memory or from a Resource

be loaded.

From version 2.3 ProSpeed may also load images in formats JPG, GIF, and WMF. From version 2.5 is

also the PNG format has been done. Then there are the two formats, which were already loaded a little longer

are BMP and RLE.

Since version 3.0 now go PNG files with transparent masks. This is one of the great

Advantages of PNG that the images can contain transparency information. The ProSpeed.dll supported

Practice all formats.

An alpha channel is an additional information that specifies for each pixel, how much of the background of

Image will show through. ProSpeed supports alpha channels of 8 bit, 256 levels of what

Transparency, equal strength. Alpha channels of 16 bits are internally counted down to 8 bits. It is therefore

it possible to smooth out, regardless of background, the edges of text and images. One can truly

Use drop shadows, fade in the background, or create images that are arbitrarily shaped.

My tip: Images with sprites should be saved as BMP, PNG, or GIF. JPG images are often

aufgepixelt saved and produced by sprites in transparency problems.

Background or other large images should be saved as a JPG, the format reached its best

Compression rates and keep nice and small programs. PNG is also this very useful.

Images can as a file directly from memory or from a resource file (. Exe or. Dll) loaded

and from 2.5 to ProSpeed directly in the source code available (Data / OEM).

From ProSpeed 2.7 images can be saved as Jpg. With version 3.0 came the ability to Png

to export with alpha channel.

From version 2.6 the ProSpeed.dll functions pack () and DePack () offers. The technique behind

these functions is, does not come from my pen. It is here the aPLib of Joergen Ibsen

used, a library that uses an LZ compressing technology, more on this below.

If they use the freeware program in ProSpeed.dll, they may pack () / Depack () / free aPLib

use, but in shareware programs and software they kommerizieller must register aPLib.

The license for aPLib get them for $ 29 (Company for $ 95) at Joergen Ibsen (

Website / Email).

Courtesy. aPLib, copyright © 1998-2002 by Joergen Ibsen.

So, I think with this powerful functionality even a beginner should succeed in a beautiful game.

Who else has ideas, or misses a very important function may be happy to sign me. I am also

willing to take a very individual function, if it appears to me reasonable and possible. Reports

you just for me ...

 

 

 

InitFX

InitFX (H)

Generating a byte array structure from an external bitmap. Necessary for all graphical effects.

H: Long - one with HDC

LoadFileImage (), LoadMemoryImage (), LoadResourceImage () or CreateImage () generated graphics data structure

Result: long - handle to a byte array structure, in error 0

New in version 1.7 are the graphical effects. Before this, however, can be applied, must (!)

be a special bitmap (as a byte array) created for this purpose (with some effects even more). These

in H must be given an HDC, and that created one with ProSpeed,% HDC should not be passed.

With InitFX () is a special copy of H is generated, which can later be manipulated directly. The contents

of H is not changed by the visual effects.

Very very important: The width of the bitmap H must be divisible by four! This is because, like Windows

manage these bitmaps. If the width is not divisible by four would be (otherwise integrated Windows

additional fill bytes), then the administrative burden would be much higher and the speed

the graphics effects would be significantly lower. I believe that is worth it.

So, always divisible by four wide, with the amount it does not matter. Please note that they otherwise

There is some FX features a fun crash ...

Each byte array must be no later than the end of the program with

FreeFX () are released back to the

Make memory free again With a picture size of 1024x768 which would be the least 2,359,296 bytes

otherwise lost.

See also

CreateFX () and PngToFX ().

Example:

exhdc (& = & CreateImage wide, height &) 'Empty bitmap in the size of the produce display'

Paint Image (exhdc &, 0,0, & width, & height,% HDC, 0,0,0) 'Copy hither content of Profanfensters

= array & InitFX (exhdc &) 'Handle (byte array) to create a bitmap'

...

FreeFX (array &) 'later release

InitPixelEffects

InitPixelEffects ()

Initiated the pixel effects.

Result: Long - Error 0 = / 0 = Initiation greater success

Important: Before

SetPixelEffect () can be used, must be prepare with InitPixelEffects () of the pixel-thread.

DeInitPixelEffects ()

Finally finished the thread again. InitSprite

InitSprite (S, F, K1, K2, X, Y, B, H, AF, SA, GA, XP, YP, SX, SY)

Created on (transparent), Sprite, and brings it animated on the screen, without the profane

Main program still has to take care of his presentation. The sprite will remain active on the screen until it

by the Delete function is deleted from the screen. This function has many

Parameters, it is then the further handling of the sprite is very simple.

S: Long - Handle of a bitmap generated with LoadFileImage () or loaded.In it must be on the sprite graphics

Q: Long - Handle of the Profanfensters (nearly always% HDC), which contains the background graphics

K1: Long - Handle of a bitmap generated with LoadFileImage () or was loaded and the background graphic includes (copy 1)

K2: Long - Handle of a bitmap generated with LoadFileImage () or was loaded and the background graphic includes (copy 2)

X: Long - X position (offset) in the sprite bitmap, can be found at the desired sprite graphics

Y: long - Y position (offset) in the sprite bitmap that can be found at the desired sprite graphics

B: long - width of the sprite

H: Long - the amount of sprites

AF: Long - the number of sprite animation. The various data of a sprite animation must be adjacent and all the same width and height

SA: Long - With this picture to start the animation (starts at 1 and not from zero).

GA: Long - speed at which the animation runs, the lower, the faster (1 = very fast)

XP: Long - X position at which the sprite is displayed in the background image

YP: Long - Y position where the sprite is displayed in the background image

SX: Long - speed of the sprite is moving on the x-axis. A movement is started, but only by MoveSprite ().

SY: long - speed of the sprite is moving on the y-axis.

A movement is, however, started only MoveSprite by ().

Result: Long - Handle this sprite in error 0

This function is the most powerful of the ProSpeed.dll. With only a function of a sprite is generated and remains

until his elimination on the screen, animated and transparent to the background.

The transparent color of each sprite is determined by the upper right of each pixel in

Sprite Graphics determined.

The various animated graphics need to be arranged on the sprite bitmap are the same and

Width and height.

Any number of sprites are generated, but the processor load of each sprite

greater. You have to test out how many sprites can be smoothly moved by what processor.

Kopie1 and 2 of the background (K1/K2) are for the Doubble buffering needed, our sprite will not even flicker.

If the function

InitSpriteBackground ( ) A background of scrolling was started, needs

InitSprite () much more processor time.

The values of XP and YP describe the position of the sprite in the background graphics, not within

the profane window. Thus, it can easily happen that is a sprite not even see the moment because

the screen just is not the relevant part of the background image displays in which the sprite

located. From version 1.6, the function

Sprite ScrollMode () that the movement behavior of the sprite

make them dependent on the window position can.

SX and SY must always be positive. Negative values are not allowed. A change in the

Direction of movement of the sprite does not reach them by others (or negative) velocity values,

but) only by other target position values (eg with MoveSprite ().

Before the end of her program every sprites must be deleted forExample by

DeleteSprite (), to

Surely they should also take into

DeleteAllSprites () use.

Example:

Sprite1 & = InitSprite (SpriteHdc &,% HDC, KopieHdc1 &, & KopieHdc2, 0,0,24,18,4,1,8,100,100,1,1)

Creates a 24 x 18 pixel wide sprite Postition of 100/100. Animated is a leisurely four steps.

More detailed example:

New & Declare, text

$, & background, & fensterkopie1, & fensterkopie2, & sprite1, sprite plane &

$ I Prospeed_Funktionen.inc 'All ProSpeed.dll incorporate features

'*** Open ProSpeed.dll

New & usedll = ( "ProSpeed.dll")

$ text = "backdrop.jpg"

background & LoadFileImage = (addr (text $)) 'Background Image (download here) 800 x 600 pixels tall

Window Style 26

Window Title "sprites demo ProSpeed.dll."

Window 0,0-800,600

'*** The background graphic on the screen copy

Paint Image (% HDC, 0,0,800,600, & background, 0,0,0)

'*** The background graphics to copy to the copy of the screen profaninterne

'*** So the window is restored, if at times parts were obscured by andereFenster.

Paint Image (% HDC2, 0,0,800,600, & background, 0,0,0)

fensterkopie1 & CreateImage = (% HDC, 800.600) 'Two Hdc's to double buffering

fensterkopie2 & CreateImage = (% HDC, 800.600) Creating '

'*** Two copies of the screen for the sprite to make double buffering

Paint Image (fensterkopie1 &, 0,0,800,600,% HDC, 0,0,0)

Paint Image (fensterkopie2 &, 0,0,800,600,% HDC, 0,0,0)

$ text = "Sprites.gif"

sprite plane LoadFileImage & = (addr (text $)) 'Load sprite graphics (jpg graphics never use this!)

(sprite1 & = & InitSprite sprite plane,% HDC, fensterkopie1 &, & fensterkopie2, 0,0,24,18,4,1,8,100,100,1,1)

WhileNot end%

     WaitInput

     Key =% Case 2: BREAK

Wend

DeleteAllSprites ()

FreeImage (& background)

FreeImage (sprite plane &)

FreeImage (fensterkopie1 &)

FreeImage (fensterkopie2 &)

New & freedll

End

InitSprite5

InitSprite5 (B)

A Secular 5 compatible solution to create sprites.

Are B: Long - range in which the 15 sprite parameters in a row (as long int) are stored

Result: Long - Handle this sprite in error 0

Secular 5 can only transfer up to 12 parameters to a dll, InitSprite () but has 15 parameters. Therefore

is InitSprite5 () the only way to sprites in "small" Profanversionen use.

What parameters are needed, is on

InitSprite be read ().

The storage area B must be dimensioned with a minimum of 64 bytes.

Example InitSprite ():

(sprite sprite plane InitSprite & = &,% HDC, fensterkopie1 &, & fensterkopie2, 0,0,24,18,4,1,8,100,100,1,1)

Example InitSprite5 ():

Long range #, 00 = sprite plane &

Long range #, 04 =% HDC

Long range #, 08 = & fensterkopie1

Long range #, 12 = & fensterkopie2

Long range #, 16 = 0

Long range #, 20 = 0

Long range #, 24 = 24

Long range #, 28 = 18

Long range #, 32 = 4

Long range #, 36 = 1

Long range #, 40 = 8

Long range #, 44 = 100

Long range #, 48 = 100

Long range #, 52 = 1

Long range #, 56 = 1

sprite = & InitSprite5 (domain #)

InitSpriteBackground

InitSpriteBackground (M, W, H, XO, YO, XR, YR)

Creates a scrolling background when working with sprites. Only with this function it is

possible scrolling and sprites-implement functions simultaneously,

Paint Image () would make the sprites flicker.

Not scroll M: Long - Scroll mode: 0 = / 1 = scrolling

B: Long - Profanfensters width of the

H: Long - the amount of Profanfensters

XO: Long - X-offset to the start of the background image

YO: Long - Y-offset to the start of the background image

XR: Long - scrolling in the X direction to XR pixels (negative values scroll to the right)

YR: Long - scrolling in the Y direction to YR pixels (negative values scroll up)

Result: Long - 0

This feature by itself is useless, and use only in conjunction with ProSpeed.dll sprites.

The scrolling of the background does not start until at least a sprite was created.

InitSpriteBackground () but should have been started before sprites were created. Although already

Sprites can exist by repeatedly calling InitSpriteBackground () nor the type of scrolling

be changed.

Special Feature: All the values of this function can be replaced by the dummy value 888,888th

Ie 888,888, which is used at this point no new value and the value by a

previous InitSpriteBackground () was set will remain.

InitSpriteBackground () makes the execution of sprites slower.

Examples:

InitSpriteBackground (1,800,600,0,0,1,0) 'Scroll within a large 800 x 600

'Window to the left

InitSpriteBackground (888888,888888,888888,80,20,888888,888888) 'Set only XO and YO to new values

InitSpriteBackground (888888,888888,888888,888888,888888,0,0) 'stop scrolling

InitSpriteBackground (0,0,0,0,0,0,0) 'scrolling

InvertChannelPng

InvertChannelPng (P, A)

Inverts the alpha channel of a PNG image.

P: Long - pointer to a png handle created using

ImportPng () or PngToFX ()

A: Long - the size of the image P in bytes, passed by ImportPng () in A

The transparency values of an 8-bit alpha channel, ranging from 0 to 255 These values are the

Function simply inverted.

IsInternet

IsInternet ()

Checks whether an Internet connection is established. See also DownloadHttpFile ().

Results: Long - If an Internet connection is open 1, in the absence of connection 0

Joystick Button

Joystick button (N)

To determine which is pressed up to 32 buttons, a joystick straight.

N: Long - the number of the joystick, 1 or 2

Result: Long - Which button is pressed.

0 = No button (or failure)

1 = A button (bit 0)

Button B 2 = (1 bit)

4 = C button (bit 2)

8 = D (bit 3)

16 = E button (bit 4)

etc. ..

Up to 32 (!) Joystick buttons are hereby requested for each of joystick 1 and 2.

The different values can also be combines. A returned value of z.B. 9 means that

Button A and Button both D

be instantly pressed.

For the evaluation of offers to Secular testbit the function @ (N1, N2).

From ProSpeed 2.0% will not need more hwnd specified. A Profanfenster is for a

Joystick query now no longer necessary. Rather, they can now choose a 1 or 2, which of two

Joysticks to be addressed. The error handling has changed. Old source code

need to be adjusted if necessary.

x & = button joystick (1)

Testbit if (x &, 0) 'button A pressed?

...

ElseIf testbit (x &, 1) 'button B pressed?

...

ElseIf testbit (x &, 2) 'C button pressed?

...

EndIf

JoystickR

JoystickR (N)

Computes the R axis of a connected joystick (rudder and pedals).

N: Long - the number of the joystick, 1 or 2

Result: Long - State of the R-axis of a joystick.

-128 = The R axis of the joystick is pushed to one side completely

0 = joystick is not moved in the R-axis

127 = The R-axis of the joystick is being pushed across to the other side

256 = Error (the joystick or joystick axis it does not exist)

The accuracy of the joystick system query is not very far away. All values between -24 and +24 should

as a non-movement of the joystick axis will be counted. All values greater than 104 or smaller than

-104 Should be considered as a full joystick movement.

JoystickU

JoystickU (N)

Computes the U axis of a connected joystick (fifth axis).

N: Long - number of the joystick, 1 or 2

Result: Long - State of the U-axis of a joystick.

= -128 The U-axis of the joystick is pushed to one side completely

0 = joystick is not moved in the U-axis

127 = The U-axis of the joystick is being pushed across to the other side

256 = Error (the joystick or joystick axis it does not exist)

The accuracy of the system joystick query is not very far away. All values between -24 and +24 should

as a non-movement of the joystick axis will be counted. All values greater than 104 or smaller than

-104 Should be considered as a full joystick movement.

JoystickV

JoystickV (N)

Determined the V axis of a connected joystick (sixth axis).

N: long - the number of joysticks, 1 or 2

Result: long - Current status of the V-axis of a joystick.

= -128 V, the axis of the joystick is pushed to one side completely

0 = joystick is not moved in the V-axis

127 = The V-axis of the joystick is being pushed across to the other side

256 = Error (the joystick or joystick axis it does not exist)

The accuracy of the joystick system query is not very far away. All values between -24 and +24 should

as a non-movement of the joystick axis will be counted. All values greater than 104 or smaller than

-104 Should be considered as a full joystick movement.

JoystickX

JoystickX (N)

Determines the left / right control of a connected joystick.

N: Long - number of the joystick, 1 or 2

Result: Long - State of the Left / Right control of a joystick.

-128 = Joystick is pressed straight way to the left

0 = joystick is not moved in the left-right axis

127 = joystick is fully depressed to the right

256 = Error (the joystick or joystick axis it does not exist)

When you score 48 forExample, the joystick is pushed just a little bit to the right.

The accuracy of the system joystick query is not very far away. All values between -24 and +24 should

as a non-movement of the joystick axis will be counted. All values greater than 112 or smaller than

-112 Should be considered as a full joystick movement.

From ProSpeed 2.0% will not need more hwnd specified. A Profanfenster is for a

Joystick query now no longer necessary. Instead they can now choose a 1 or 2, which of two

Joysticks to be addressed. The error handling has changed. Old source code

need to be adjusted if necessary.

Joysticky

Joysticky (N)

Determines the Up / Down control of a connected joystick.

N: Long - the number of joysticks, 1 or 2

Result: Long - State of the up / down control of a joystick.

= -128 Joystick is pressed straight to the top

0 = joystick is not moved in the left-right axis

127 = joystick is completely pushed down

256 = Error (the joystick or joystick axis it does not exist)

At the value 48 forExample, the joystick is pushed just a little bit down.

The precision of the joystick system query is not very far away. All values between -24 and +24 should

as a non-movement of the joystick axis will be counted. All values of greater than 104 or less than

-104 Should be considered as a full joystick movement.

From ProSpeed 2.0% more need not be given hwnd. A Profanfenster is for a

Joystick query now no longer necessary. Rather, they can now choose a 1 or 2, which of two

Joysticks to be addressed. The error handling has changed. Old source code

need to be modified if necessary.

JoystickZ

JoystickZ (N)

Determines the Z axis of a connected joystick.

N: Long - number of the joystick, 1 or 2

Result: Long - State of the Z-axis of a joystick.

-128 = The Z axis of the joystick is pushed to one side completely

0 = joystick is not moved in the z-axis

127 = The Z-axis of the joystick is being pushed across to the other side

256 = Error (the joystick or joystick axis it does not exist)

The accuracy of the system joystick query is not very far away. All values between -24 and +24 should

as a non-movement of the joystick axis will be counted. All values of greater than 104 or less than

-104 Should be considered as a full joystick movement.

Compression

Compression:

Lighten

Lighten (F, X, Y, B, S)

Brightening of the screen (or portions thereof) to a white surface.

Q: Long - Handle of the target bitmap (HDC) or 0

X: Long - X offset to the screen

Y: Long - Y offset to screen

B: Long - one with a handle

PngToFX (), InitFX () or CreateFX () produced byte arrays (source bitmap)

S: Long - step of brightening

Result: Long - 0

The screen is illuminated by S levels. S may here from 1 to 255th The current graphics mode is

this feature does not matter. Intern is expected with 24 bits.

X and Y specify the upper left corner, from where the screen is illuminated. The size of the lightening

Zone results from the size of the bitmap that is specified in InitFX () / CreateFX ().

For F one of profane can either be specified or a bitmap, with LoadFileImage () /

CreateImage () was created. Is passed, however, for F 0, the function will be executed but

not brought to the screen.

Lighten () is pretty fast and works in real time. Larger screens (egB. 1024x768) should be based on

slow computers, but not in 1-step increments are evident. From a 600 processor should

Speed range for this purpose, however.

Generally, the smaller the area, the faster it will manifest.

Before Lighten () can be applied must be a InitFX preparation with () have taken place.

The data in byte array B is changed by calling this function ..

Example:

A screen will slowly clear:

= array & InitFX (exhdc &) 'Handle (byte array) to create a bitmap

WhileLoop 256

     Lighten (% HDC, 0,0, & array, 1)

EndWhile

FreeFX (array &) 'later release

Antialiasing

Antialiasing (H, X, Y, B, R, B, D)

Blurs the edges of a graph, or alternatively, the entire graph and attempts by the staircase effect

curb ..

Significantly slower than forB. blur () when only the margins are affected by the effect.

H: Long - Handle of the target bitmap (HDC) or 0

X: Long - X offset to the screen

Y: Long - Y offset to the screen

B: Long - one with a handle

PngToFX (), InitFX () or CreateFX () generated Bytes

Arrays

R: Long - rgb value of transparent color, or -1

Q: Long - Flags

A: long - number of passes of the effect

Result: Long - 0

However, no image and the transparent part of the image B are mixed soft

(Antialiasing). Thus, the hard edges smoothed.

X and Y specify the upper-left corner of the image B is later shown in H. The size of the

rectangle to be displayed is derived from the size of the bitmap specified in InitFX () / CreateFX ()

was.

For H either one of the profane bitmaps (% HDC% HDC2 ...) can be specified or associated with

Produced LoadFileImage () / CreateImage () was. If H = 0, then the anti-aliasing will be canceled, but

not shown.

The data in the byte array B are produced by invoking anti-aliasing, of course, changed.

R is the transparent color, is at its limits, the anti-aliasing. If R = -1, then the color is

the upper-right pixel of B taken as the transparent color.

F are various flags. If F = 0, then Method 1 is used for antialiasing. F = 1 uses a

other method. Additionally you may be set bit 1 of R (that) must be added the value of R 2, if not

only the edges, but the artwork will be smoothed. In the case of this effort is

Not so high and it works faster.

If A is either 0 or 1, then antialiasing is run () only once. It can also be a greater

Value can be specified if the anti-aliasing will be worse. In this case, the function is more

go through this course and lasts longer.

AttachSprite

AttachSprite (H, ZH, XO, YO)

Sprite H attempts to automatically take the position that is located at the moment Sprite ZH,

by far the XO, YO.

H: Long - one with a handle

InitSprite () generated sprites

ZH: Long - one with a goal-Handle

InitSprite () generated sprites

XO: Long - X Offset, X-distance to the target sprite

YO: Long - Y offset, y-distance to the target sprite

Result: Long - 0

With this feature, you can realize how great sprite effects, and with little user effort.

In order forPresented as a worm, several Sprite (perhaps chained balls) with AttachSprite ()

will. These hunts Sprite 1, after the sprite 2nd 3 behind Sprite Sprite 2 ago, 4 behind 3, etc., all with

small distance. Now just need sprite 1 are moved, and the other sprites move

wormlike automatically afterwards. It should, however, will have all the sprites the same speed.

To unlock the Attach for Sprite H again, must be a given zero for ZH:

AttachSprite (attachsprite &, & sprite, 10,10)

...

AttachSprite (attachsprite &, 0,0,0) 'Attachmodus quit again

LoadFileImage

LoadFileImage (S)

Loads an image into memory for later use. It is possible the graphics formats BMP, JPG, PNG,

Loading GIF, and WMF.

S: string containing the name of a picture file (. Bmp,. Jpg,. Gif,. Png,. Wmf)

Result: long - held handle of a memory device context (in-memory image data structure, HDC).

On failure 0

Example:

$ text = "Picture.jpg"

ExternHDC & LoadFileImage = (Addr ($ text))

The loaded image or bitmap is kept so long in the memory until it through

Free Image () again

unloaded. This should be done at the end of the program to provide the resources free again.

Currently can be simultaneously held in memory up to 32 external bitmaps. See also

LoadMemoryImage ()

and LoadResourceImage (). LoadMemoryImage

LoadMemoryImage (B, A)

Acquire images into memory for later use. All of the graphics formats BMP, JPG, GIF,

PNG and WMF to be such a memory area (Example of an area) out loaded.

B: range variable

A: Long - Number of bytes in the range

Results: Long - Held handle of a memory device context (in-memory image data structure, HDC).

On failure 0

Example:

$ text = "Picture.jpg"

length & = @ FileSize ($ text)

If & length> 0

Dim memory #, length &

ReadFileFast (addr ($ text), memory #, 0, & length)

ExternHDC & = LoadMemoryImage (memory #, & length)

Dispose memory #

EndIf

The loaded / fetched or bitmap will be kept so long in the memory until it through

FreeImage ()

is unloaded. This should be done at the end of the program to provide the resources free again.

Currently can be simultaneously held in memory up to 32 external bitmaps.

LoadResourceImage

LoadResourceImage (H, S)

Loads an image from a resource file into memory for later use. BMP,

JPG, GIF, PNG and WMF are supported as image files. A resource file can be a DLL or

one Exeprogramm (forAs our own) that is linked together with data.

H: Long - hInstance a Exedatei or the handle from a loaded dll.

S: Long - the number of the resource or string with the name of the resource

Results: Long - Held handle of a memory device context (in-memory image data structure, HDC).

On failure 0

Examples:

1)

dll & usedll = ( "Resource.dll")

$ text = "Image1"

ExternHDC & LoadResourceImage = (dll &, addr ($ text))

2)

ExternHDC & LoadResourceImage = (% hInstance, 100)

For S is a number (long) or can a specify string (resource name). It can even be a number

be specified in the string, then the first character in the string must be a # and the rest is as a figure

interpreted, suchB. $ text = "# 100". S for a string is specified, then it must be at least 3 characters

contain names with fewer characters are not allowed.

For H is a DLL or HInstance of Exeprogramm can be specified, including a foreign

Exeprogramm, which contains resources that can be shown if the hInstance of this program was established.

Important: bmp files in resources can be stored as resource type "Bitmap" or "IMAGE.

All other graphics files must be as resource type "IMAGE" to be saved! Thus, forAs a jpg image

not found, which was stored as type "BITMAP" ...

The loaded image or bitmap is kept so long in the memory until it through

Free Image () again

unloaded. This should be done at the end of the program in order to provide the resources free again.

Currently may be simultaneously held in memory up to 32 external bitmaps.

LongToAddrVar4

LongToAddrVar4 (V, A, W1, W2, W3, W4)

Writes four Longs from an area directly in four variables (Long). Only works from 7th Secular

V: range variable

A: Long - Offset Address

W1: Long - address of variable 1

W2: Long - address of variable 2

W3: Long - address of variable 3

W4: Long - Address of Variable 4

Results: Long - 0

For example, with these values in long-range #:

Address: 0 4 8 12 ...

Value: 1465 111 333 2716 78 ...

LongToAddrVar4 (area #, 0, addr (x &), addr (y &), addr (z &), addr (A &))

According to this function, x = 1465 & y = 111 & z = 333 and & a & = 271,678

Mark Sprite

Mark Sprite (H, Z)

Marks the sprite to the handle with the number Z. H

H: Long - one with a handle InitSprite () generated sprites

Z: Long - the number

Result: Long - 0

Marks a sprite. Thus, after a certain sprite-type numbers are detected, suchExample, after a collision.

See also

GetSpriteMark ().Very useful feature ...

Mark Sprite (sprite &, 111)

Merge

Merge (Q, Z, F)

Merger / combination of two images.

Q: Long - one with a spring handle

PngToFX (), InitFX () or CreateFX () erze ugten byte arrays

Z: Long - one with a goal-Handle

InitFX () or CreateFX () generated byte arrays

Q: Long - Flags

Result: Long - 0

The diagram of the byte array Q is copied to the graphics of Z. Q and Z must have the same estimation of distance

. have According to Z, only the pixels are copied from Q, which do not have the transparent color. Where

the upper-right pixel of Q the color of the transparent color determined.

F contains the flags. If F = 0, then the picture is normally copied. If F = 1, when they will be additionally

smoothed the edges of the graph, which is copied to (anti-aliasing). If F = 3, then the edge of the graphic is not

copied. With the flags 1 a.m. to 3 p.m. graphics are blended almost seamlessly with the target image.

The fused image is located after calling merge () in Z. In order to bring it to the screen,

CopyFX can be used (). The graph in Q is not changed.

MergeChannelPng

MergeChannelPng (P, Z, A, S)

Nearing the alpha channel of a PNG handle the alpha channel of another Png handles.

Reunification for graphic masks also.

P: Long - pointer to a png handle (source), created with

ImportPng () or PngToFX ()

Z: Long - pointer to a png handle (target), created with

ImportPng () or PngToFX ()

A: Long - the size of the images P and Z in bytes that was passed by ImportPng () in A

S: Long - Progress of approximation (1-32)

Results: Long - the number of approximations. At 0, both Alpha channels are identical.

This nice effects are possible. The graph in P and Z is not changed, only the alpha channel of Z is

the alpha channel of P similarly made.

S indicates whether this approach should go faster or not, and represents a number of steps.

After a maximum of 256 steps, the approach has been fully completed. The end of convergence should

but are always checked by means of the results of this function.

See also

MergeImagePng ().

Example:

$ text = "png3.png"

pnghandle1 & = (ImportPng addr ($ text), addr (& width), addr (& height), addr (number & bytes))

$ text = "png4.png"

pnghandle2 & = (ImportPng addr ($ text), addr (& width), addr (& height), addr (bytes & number))

If pnghandle1 &

WhileLoop 256

PaintPng (pnghandle1 &, number & bytes,% hdc, & loop * 3, & loop, & width, & height,% hdc2)

X & Inc

z & = MergeChannelPng (pnghandle1 &, & pnghandle2, number & bytes, 2)

Case & z = 0: BREAK

EndWhile

FreePng (pnghandle1 &)

FreePng (pnghandle2 &)

EndIf

MergeImagePng

MergeImagePng (P, Z, A, S)

Approximates the image data to a PNG handle the image data of another Png handles.

P: Long - pointer to a png handle (source), created with

ImportPng () or PngToFX ()

Z: Long - pointer to a png handle (target), created with

ImportPng () or PngToFX ()

A: Long - the size of the images P and Z in bytes that was passed by ImportPng () in A

S: Long - Progress of approximation (1-32)

Results: Long - the number of approximations. At 0, both alpha channels are identical.

This nice effects are possible. The graph in P is made of similar graphic in P.

S indicates whether this approach is to go faster or not, and represents a number of steps.

After 256 steps later than the approach has been fully completed. The end of convergence should

but are always checked by means of the results of this function.

See also

MergeChannelPng ().

Example:

$ text = "png3.png"

pnghandle1 & = (ImportPng addr ($ text), addr (& width), addr (& height), addr (number & bytes))

$ text = "png4.png"

pnghandle2 & = (ImportPng addr ($ text), addr (& width), addr (& height), addr (number & bytes))

If pnghandle1 &

WhileLoop 256

PaintPng (pnghandle1 &, number & bytes,% hdc, & loop * 3, & loop, & width, & height,% hdc2)

X & Inc

z & = MergeImagePng (pnghandle1 &, & pnghandle2, number and bytes, 2)

Case & z = 0: BREAK

EndWhile

FreePng (pnghandle1 &)

FreePng (pnghandle2 &)

EndIf

Mouse Button

Mouse Button ()

Determine which mouse button is pressed.

Result: Long - Which key is pressed.

0 = No button (or failure)

1 = left button (bit 0)

2 = right button (bit 1)

4 = middle button (bit 2)

The result value can be combined. A returned value of z.B. 5 means that the left

Mouse button and the middle mouse button are both currently depressed.

To evaluate the function of Secular offers

@ Testbit (N1, N2) to.

This function has some advantages over the Profan-Variablen/Funktionen. The Mouse may Button ()

finally be queried and the middle mouse button, if available. In addition, all mouse buttons can

simultaneously queried, and the status here is not by

WaitInput or WaitMouse lost.

 

x & = Mouse Button ()

Testbit if (x &, 0) 'left mouse button pressed?

...

ElseIf testbit (x &, 1) 'Right mouse button pressed?

...

ElseIf testbit (x &, 2) 'Middle mouse button pressed?

...

EndIf

MouseOverSprite

MouseOverSprite (B, A, X, Y)

Tests whether the mouse is over a sprite.

B: Long - range variable in a list of sprite handles (Longs) stands.

A: Long - the number of Sprite handles that are in Area B.

X: Long - Profanvariable% mouseX

Y: Long - Profanvariable% mousey

Result: Long - 0, on error or no contact, otherwise the first tangent handle sprites from the area B, the pointer is currently affected.

X and Y is usually called the upper-left corner of the mouse.

This feature is perfect for games hervoragend a la grouse.

Example:

VarToLong4 (area #, 0, & sprite1, sprite2 &, & sprite3, sprite4 &)

VarToLong4 (area #, 16, sprite5 &, & sprite6, sprite7 &, & sprite8)

VarToLong4 (area # 32, sprite9 &, sprite10 &, 0,0) '10 Sprite handle in

Area Profile

x & = # check (MouseOverSprite range, 10% mouseX,% mousey) 'if one of the sprites just touches the "mouse pointer.

Casenote @ Equ (x &, 0): DeleteSprite (x &) 'grouse would now delete the sprite

MoveSprite

MoveSprite (H, X, Y)

Moves the sprite to the handle H with its new coordinates.

H: Long - one with a handle

InitSprite () generated sprites

X: Long - New X target position of the sprite

Y: Long - New Y target position of the sprite

Result: Long - 0

The sprite with the handle H will now automatically go to the new coordinates completely

independent of the Secular program.

The speed of the sprite for his movement was already in

InitSprite () but it can

through

SetSpriteSpeed () be changed ..

The animation of the sprites still running.

There are two modes of motion, see

SetSpriteMovingMode ().

MoveSprite (& sprite, 400.300)

MoveSpriteWithTable

MoveSpriteWithTable (H, B, A, X, Y, S)

Sets a sprite for a defined movement path. The X and Y values for this are from a previously

generated table read.

H: Long - one with a handle InitSprite () generated sprites

B: Long - range variable is in the in table form, a list of screen space coordinates (or 0).

A: Long - the number of coordinate pairs in Table B

X: Long - X offset that is added to each X-coordinate (must also be negative)

Y: Long - Y offset, for each Y-coordinate is added (must also be negative)

S: Long - Startkoordinatenpaar, 1 to ..., from where it starts reading from the table

Result: Long - 0

So far, a Sprite could be given only one point on the screen at which it will move.

From ProSpeed 2.1 a sprite can perform any movement on the screen. For this purpose, the

Read table B, a pair of coordinates on which the sprite is moving next. Is there

come will be read the next coordinates, etc.

Has reached the end of the table can then be read from the starting point of the table further. If the

Table are processed only once, then they can use this single-mode

Table Sprite Fashion ()

or set aside again.

The values in the table must be an integer (word) to be saved, always a word for X, and then one

for Y, then X, Y, X, Y, ...

To generate such a table is

Moritz Pathfinder Kersten well suited to the ProSpeed -

Package as freeware accompanied by:

But even with the function

PixelToMemory () can be generated from an image a coordinate table.

An example of the use of such movements would be for SpriteAs a jump-and-run game or a shooter game a la

Rtype.

If B = 0, it behaves the sprite back to normal, it still flies up to the last-mentioned

Coordinates then stops.

The table in the way, B is copied from ProSpeed and need not remain in the range variables.

For example, a sprite ever to fly around the screen:

$ Text = "0,0,1024,0,1024,768,0,768" 'coordinate values

SetWords (area #, 0, Addr (Text $)) 'as a word-integers in the field to enter #

sprite = (...) & InitSprite

MoveSpriteWithTable (& sprite, area #, 4,0,0,1) 'and head off

If you want to reverse the trajectory of the sprite (it should, therefore, the table values) departing in reverse order, then provides the function

ChangeLongSequence (an) to reverse any coordinate values.

The above example would then read thus:

$ Text = "0,0,1024,0,1024,768,0,768" 'coordinate values

SetWords (area #, 0, Addr (Text $)) 'as a word-integers in the field adding #

ChangeLongSequence (area #, reverse 16) 'Table values = (Sprite fly the other way around)

sprite = (...) & InitSprite

MoveSpriteWithTable (& sprite, area #, 4,0,0,1) 'and head off

NoStars

NoStars (P)

This function terminates a star field. Here, there are several methods.

P: Long - parameters for the end of the stellar field

Result: Long - 0

A star field, finished with one of several methods. For P one of the following values

be used:

0 = not cancel Sternfeld.

1 = Sternfeld will be terminated immediately without clearing the stars from the screen.

2 = Sternfeld will be terminated immediately, all the stars but are still cleared from the screen (image is restored).

3 = Sternfeld is slowly closed. It will not create more new stars, but the

existing stars are moving even further, until they disappeared from view.

Whether the star field is already over, can with

Status stars () are queried.

NoStars (3)

OemBytes

OemBytes (S)

A compact form of

Data Bytes () / data.The data is not passed, but as numbers but as OEM characters.

"OemBytes ()" is also available as a procedure "OEM".

P: Address of a string with input instructions

Results: Long - 0

OemBytes / Oem goes a step further as data bytes / data.

The code in S is much more compact, but not editable.

First, is determined by Datames (), to which area OemBytes access / Oem next.

Datames () do this automatically sets the positioning to the first byte of the target area (

DataPos (0)):

Declare range #

Dim range #, 733

Clear area #

Datames (domain #)

Oem yoya 3JFIF # # $ $ # $ # $ # # # Yu # C #. + + - + *. --

OEM ", - 0 /. 0 4? 5 4 2 2 4 E <= 7?)$+*($''- 2 @ 7-0 = 0''8 "

Oem "L9 = CEHIH +6 OUNFT @ GHEÿÛ # C $ / 0 0 4 2 4 D 5 5 EN. '.EEEEE "

Oem EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEÿÀ # 4 + # "

Oem "0 #: & $ E #% 4 $ & 4 $ yÄ # B # # $ ($ $ $ $ $ $ # # #"

Oem # # # # # $% & '() * +, -. YÄ μ # 3 # $% & &%' & '

Oem "(( '' #) # $ $% & # '4 (5 D1A) * 6QA Eq 72?'¡+ # "

Oem B ± Á 8RÑð $ 3br,, - 9:; <=%&'()* 456,789: CDEFGHIJSTUVWXY "

Oem Zcdefghijstuvwxyzƒ "…† ‡ ‰ Š ' "" •!2!3 ~ ™ š ¢£¤¥|§¨©ª²³' μ ¶·¸¹º  "

Oem ÃÄÅÆÇÈÉÊÒÓÔÕÖ × ØÙÚáâãäåæçèéêñòóôõö ÷ øùúÿÄ # B $ # & $ $ $ "

Oem $ $ $ $ $ $ # # # # # # $% & '() * +, -. YÄ μ # 4 # "

Oem "% $% '' & '* (' '# $% w # $% & 4' (D1) 5AQ * a"

Oem "q 6 E2? 7B + '¡± Á, # 3Rð 8brÑ - 9 $ 4A% ñ:; <=&'()* 56,789 "

Oem CDEFGHIJSTUVWXYZcdefghijstuvwxyz, ƒ "…† ‡ ‰ Š ' "" •!2!3 ~ ™ š ¢ £ ¤ "

Oem "¥|§¨©ª²³' μ ¶·¸¹º ÂÃÄÅÆÇÈÉÊÒÓÔÕÖ × ØÙÚâãäåæçèéêòóôõö ÷ øùúÿÚ # "

Oem / & $ #% # 4 & 4! # ò ª (IK ^ EM-% © QKE> _0 5S ^ ÔQo0 - (ih ª μ ' "

Oem "3!é (Rw ¥ IR ¾ ¸ ¢ Ðà!J; ouw # IA £ μ 7ŸP 1ÆŠ; žÈBw =* ¥ ¢ Ž =* TwÔaE? "

Oem zQÇ ¥ U ¼ Ä'jZ8ô £?J «¸; = (Í 7ß @?Yu "

(This source code uses the procedure "OEM". If they file in their program

ProSpeed_Funktionen.inc

integrated, they can access it, from Secular 7.)

With this source would be 732 bytes in the area described area # ", in this case a small

Jpg image.

The example has been with the program

Created Oemgenerator (supplied with the package as a source and ProSpeed

as an executable with), can be transformed with the very convenient to any file in OEM lines. So

generated row can be copied directly into the Secular-Source, Inc., or saved as a file

will.

OemBytes () / Oem may very well be used to images or other data directly into the

Source code to integrate.

An illustrative example is the Oemgenerator source code itself. In any case reinschauen times.

Option Stars

Option Stars (XO, YO, X, Y, G)

This feature affects the behavior of star in a star field with

Generates Stars () was.

XO: Long - X-offset, this value added to the center of a star field

YO: Long - Y offset, this value added to the center of a star field

X: Long - X-velocity of the star to add this value

Y: Long - Y-velocity of the star to add this value

DR: Long - speed of the stars (see G in

Stars ())

Result: Long - 0

A field of stars can be affected hereby.

With XO and YO the midpoint of the stellar field can be moved, the stars will not therefore appear

longer necessarily in the middle of the field on. Negative values move the center to the left, or after

above. Positive values to the right, or down.

X and Y to add the value to the normal velocity of each star. The stars can therefore be a

Tendency in one direction be given, where negative values tendencies to the left, or

Top generate. Here values are useful from -10 to 10.

G change the movement speed of all stars.

Option stars () can be called often, with the new values overwrite the previously set values.

Option stars (100,100,2,2,4)

Pack

Pack (Q, Z, A, P)

Compressed (packed), a data area by LZ77 technique. Additionally, the memory can packed with a

Password protected.

Q: Long - pointer for the source data,As a pointer to an area with data.

Z: Long - Pointer to the destination (pointer to an area), compressed data stored in the media

are (Z = Q should not be here, a second storage area is needed).

A: Long - Size of the data area (number) to thrilling bytes.

P: Long - pointer to a string / field that contains a password, or 0 (no password is used)

Result: long - Size of the packed data field (number of packed bytes that are now in Z). At

Error = 0

Attention:

The technology that lies behind pack (), does not come from my pen. It is here the aPLib of

Joergen Ibsen uses a library that uses an LZ compressing technology, read more

below.

If they use the in ProSpeed.dll freeware program, they may pack () / free aPLib

use, but in kommerizieller Shareware programs and software they need aPLib

. Sign up

The license for aPLib get them for $ 29 (Company for $ 95) at Joergen Ibsen (

Website / Email).

Courtesy. aPLib, copyright © 1998-2005 by Jørgen Ibsen.

ProSpeed 2.6 Since there is this feature pack. Pack () is a true all-rounder, but unfortunately quite slow.

Pack () is compressed to about equal to or better than WinZip, this time the pack results

different methods to one (about 3 MB large text file Winner Winrar is unbeatable):

Original text = 3,087,250 Bytes (100.0%)

packed with WinZip (best level) = 462,998 bytes (15.0%)

packed with the packing () = 446,721 Bytes (14.5%)

packed with WinRar = 184,458 bytes (6.0%)

Pack () can also keep up very well in comparison to the (current) market leader Winzip. By PackRat

than 80% are therefore not uncommon.

Here's another example, this time a huge bmp image (4096 x 4096!) with over 50 MB of allocated memory.

Download original image (. Bmp) = 50,331,702 Bytes (100.0%)

as an image (. png) = 661,447 bytes (1.3%)

packed with WinZip (best level) = 611,139 bytes (1.2%)

packed with the packing () = 575,345 bytes (1.1%)

packed with WinRar = 382,297 bytes (0.8%)

The order has not changed. PNG is still present, the best lossless compression

Method for graphics.

Wow, pack () with almost 99% space savings that can be seen already ...

Q and Z are pointer to storage areas in the Q data to be packed stand in Z are

the compressed data is then written back. Important: There must be two different

Memory areas are used!

The store in Z must contain enough space to compression in the case of an unsuccessful no mistake

. cause This formula can be calculated in the least number of bytes within Z:

Number of bytes = A + (A / 8) + 64

A indicates how much data is in Q will be packed.

P) can be a string (or an area where a password is. If P = 0, then the information is

just packed. Is in P, but the password, the packed data is also very experienced with this

Encrypted password. The encryption is based on the function

Crypt (), where there is more info

thereon.

With pack () compressed data can only

DePack () again decompress / decrypt!

And respect: A compressed file can be extracted without the password no longer valid!

Here is an example to load data by pack (), compress and encrypt:

$ text = "File Name"

(bytes FileSize = & $ text)

Dim range #, bytes &

Dim target area #, bytes + (& & bytes / 8) +64

ReadFileFast (addr ($ text), area #, 0, & bytes)

$ text = "password"

x & = pack (area #, target area #, & bytes, addr ($ text))

Print "Old File Length =" + Str $ (& bytes) + "bytes."

Print "New file length =" + Str $ (x &) + "bytes (" + Str $ (x & & * 100/bytes) + "% remaining)."

Old file length = 48,030 bytes.

New file length = 5408 bytes (11.259629% remaining).

Paint Image

Paint Image (Z, X1, Y1, B, H, Q, X2, X3, K)

Copies parts of an image or the image on the screen or in a different picture.

Z: Long - Handle of the target bitmap forSecular as the main window

X1: Long - left coordinate in the destination bitmap

Y1: Long - the upper coordinate in the destination bitmap

B: Long - Width of the rectangle to be copied

H: Long - height of the rectangle to be copied

Q: Long - Trade of the source bitmap

X2: Long - left coordinate in the source bitmap

Y2: Long - the upper coordinate in the source bitmap

K: Long - Copy mode

Results: Long - TRUE, FALSE on error

.

The screen section of the source bitmap starting at X1, Y1 of a width of W pixels and a height

has H pixels, then the position X2, copied Y2 in the target bitmap. The last parameter determines the copy mode.

As a commercial for the source and the destination bitmap Profanfenster (% HDC) can be specified, or by

LoadFileImage () or

CreateImage () received value.

It can also be specified profane the HDC's internal memory bitmap, it is determined:

Start Paint -1

SpeicherHDC & =% HDC

EndPaint

Values for the copy mode are:

-1 = (Transparent transparent color pixels = top-right of the

Source rectangle)

0 = normal copy

1 = source and destination to combine AND

2 = Source and target with OR connect

3 = source and destination with XOR link

4 = Invert destination (source is not included)

5 to 12 = other interconnection techniques

13 = black (default) Delete

14 = default (Clear White)

Copy mode is selected as the -1, then the color of the upper-right of the pixel is to be copied

Rectangle of the selected source bitmap as the transparent color, in contrast to the original profane

Transparent mode, where the transparent pixels will be selected on the left below.

All pixels that have the transparent color, not to be copied. Thus it is possible, even graphics on

bring to the screen that are not rectangular, have particularly a very individual form.

Example:

$ text = "Picture.bmp"

exhdc & Load LoadFileImage = (addr (text $)) 'external image into a bitmap

width = & GetWidthImage (exhdc &) 'Ö of image width and height

& height = GetHeightImage (exhdc &) identify '

Paint Image (% hdc, 200,100, width &, & height, & exhdc, 0,0,0) 'The external image into the main window at position

'X = 200 / copy Y = 100.

Paint Image (% hdc2, 200,100, broad &, & height, & exhdc, 0,0,0) 'If necessary. the external image in the Secular

'Copy restoration bitmap (% hdc2), then' our image even with the window overlays' again automatically restored!

FreeImage (exhdc &) 'External Image Share

PaintPng

PaintPng (P, A, Z, X, Y, B, H, Q)

Copies a PNG image with alpha channel to an HDC.

P: Long - pointer to a png handle created using

ImportPng () or PngToFX ()

A: Long - the size of the image P in bytes that was passed by ImportPng () in A

H: Long - Handle of the source and destination bitmap (HDC)

X: Long - X offset to the screen

Y: Long - Y offset to the screen

B: Long - Width of the PNG image P

H: Long - the amount of the PNG image P

Q: Long - 0 or handle to a source bitmap (HDC)

Results: Long - TRUE, 0 on error

This function copies a PNG with alpha channel to an HDC.

PaintPng () needed for his work from two sources, namely, P and H. If Q is not equal to 0, then

P and Q are used as sources. Q can therefore be used as DoubleBuffering so that the

Result of this function, the source for other calls will not overwrite (Q is equal to zero, then remains

these parameters) unused.

A source is therefore P, the other H (or Q). PaintPng () now combined the two using the alpha channel (in

P) and generated from the two images of one, and it zeichet finish H at pixel position X and Y.

The width B and height H must include the dimension of the PNG image.

A is the size of PNGs in bytes. The value ImportPng (A) constitutes returns.

Important: The width of picture P must be evenly divisible by four!

Example:

$ text = "png.png"

handle (& addr = ImportPng ($ text), addr (x &), addr (y &), addr (& bytes))

If handle &

WhileLoop 156

PaintPng (handle &, & bytes,% hdc, -512 + (& loop * 8), 20 x & y &,% hdc2)

EndWhile

FreePng (handle &)

Endif

PixelToMemory

PixelToMemory (H, B, S)

The graph in the byte array H is scanned pixel by pixel and the determined X and Y coordinates are in

Area B stored as a table. Very useful in conjunction with

MoveSpriteWithTable ()

H: Long - Handle with a generated CreateFX, PngToFX () or InitFX Bytes

Arrays

B: Long - range in which the coordinates table is generated sufficient dimension (!)

S: Long - step size in pixels is scanned with the graphic, 1 to ... (never zero!)

Result: Long - Number of bytes (!) That were recorded in Area B.

Since version 2.1 ProSpeed sprites can move in every possible trajectory. For this purpose it uses a

special table with X and Y coordinates.

With PixelToMemory () can then generate a table of almost any graphic object, if the graph

The following criteria are met.

1) the pixel of the graphics must be black (ie, the background is best to know)

2) each pixel can have a maximum of two neighboring pixels, which can either sit up, down, left, right or in one of the four diagonal corners.

So are no overlapping lines and no lines that are thicker than one pixel will be allowed.

3) the graph line should not be interrupted

4) the line must not leave the bitmap

Under the graphic of the magnified image shows an incorrect

 

              

Line, where the fault lies with blue pixels (some pixels are only

were displayed in color and numbered in order to demonstrate the error).

The blue pixel has three neighboring pixels (see criterion 2), which in

Calculate the table of coordinates lead to errors.

If they use so PixelToMemory (), then they must all criteria

and respect necessary, rework the graphics by hand. Links in

Figure it would be forB. offer to erase pixels No. 2 to ...

Table B, is generated is then made integers (Words), always a word for

X-coordinate, then a word for the Y coordinate, then X, Y, X, Y, etc. ,.... Each one X and one Y-value

One point on the screen.

Here an example:

This image (160x160, black and white, saved as. Gif) was mixed with a paint program via Polygon

Mode painted (the Kiterien please note). Now we transform the image coordinate pairs to, via:

PixelToMemory (array &, area # 1)

If we were to paint using the generated values in the table now back lines

would look exactly the original image (in this case, 702 pairs of coordinates).

Now let's walk the same picture in order to coordinate pairs, this time using:

PixelToMemory (array &, area # 64)

Now we would paint this picture, if we coordinate our back as lines

(paint in this case 10 pairs of coordinates):

The step S is, therefore, vieviele coordinates compared to the read image pixels in the

Are entered in Table B. A value of 1 indicates that the position of each pixel as a table value

is used, a value of 30 forExample indicates, is entered, the only one in 30ste pixels. The higher the value

is in S, the more accurate the line in Figure H stored as a table, and the fewer pairs of coordinates

be calculated.

Here is the way, the 7-Secular code to implement a table of coordinates back into line:

$ text = "Testbild.gif" 'Load image

LoadFileImage & pic = (addr (text $)) '

= array & InitFX (pic &) 'and into a byte array to copy #

a & = PixelToMemory (array area & #,, 64)

x & = Word (area #, 0)

y & = Word (area # 2)

MoveTo x & y &

z & = 0

Whileloop a & / 4

      x & = Word (area #, z &)

      y & = Word (area #, z & +2)

      LineTo x & y &

      z = z & & +4

Wend

x & = Word (range #, 0)

y & = Word (area # 2)

LineTo x & y &

FreeFX (array &)

FreeImage (& pic)

PMouse

PMouse (X1, Y1, X2, Y2)

A replacement for Secular's Mouse Function (...), which does not work if the user message

WM_MOUSEMOVE has been set. PMouse () also works.

X1: Long - Left Edge

Y1: Long - Upper Corner

X2: long - Right Corner

Y2: Long - Lower Corner

Result: Long - 0 or not equal to 0

If the mouse pointer just inside the specified rectangle, the result is <> 0 if

not, the result is 0

PngToFX

PngToFX (P, B, H, A, M)

Creates a handle PNG with alpha channel (or two) bytes array structure (s) for graphical effects.

P: Long - pointer to a png handle created using

ImportPng () or PngToFX ()

B: Long - Width of the PNG image P

H: Long - the amount of the PNG image P

A: Long - the size of the image P in bytes, passed by ImportPng () in A

M: Long - 0 or a pointer to a Long, which the handle of another byte

Array structure returns

Result: long - handle to a byte array structure, in error 0

From version 3.0 supports the ProSpeed.dll png files with the widespread 8/16-bit alpha channel. To

these files to make them compatible with the graphical effects, there is this function.

P is the handle of a PNG's with alpha channel. W and H specify the width. A is the size of the png's in

Bytes, so the value that ImportPng (A) constitutes returns.

The result of this function is a byte array of a graphical effect with the pure image of P and

the dimensions W times H.

If M is not equal to 0, then M is given in another byte array containing the alpha channel data from P.

This byte array, and the need to handle the result of the function no later than end of the program

with

FreeFX () will be released.

Example:

$ text = "png.png"

ImportPng & pnghandle = (addr ($ text), addr (& width), addr (& height), addr (number & bytes))

If pnghandle &

= array & PngToFX (pnghandle &, & width, & height, number & bytes, addr (maskarray &))

FreePng (pnghandle &)

If array &

CopyFX (% HDC, 0.0, array &)

CopyFX (% HDC,% width & maxx, maxy-height% &, & maskarray)

FreeFX (array &)

FreeFX (maskarray &)

Endif

Endif

Random

Random (B, L, A, M)

Writes any number of generated random values in a range.

B: Long - the area that will contain random numbers.

L: long - number of Longs, which should be written in the field (1 Long = 4 bytes)

To be A: Long - value added to each random number, or 0

M: Long - maximum value of the generated random numbers

Result: Long - 0

All the random numbers generated will be written as LongInteger in memory (area). The

Area must first be adequately dimensioned, of course.

It produced figures which are between 0 and M-1, then A is not added added (A and can also be negative).

Examples:

'# 100 *** Produced in the area from 1000 to 1199 random numbers)

Random (area #, 100,1000,200)

'*** Produced in the field # 4000 random numbers from -1000 to 0)

Random (area # 4000, -1000.1000)

'*** Produced in the field # 30 random numbers between 0 and 1)

Random (range #, 30,0,2)

ReadFileFast

ReadFileFast (S, B, O, A)

Fast reading a file in one area.

S: pointer of a string with the name of a file.

B: Long - range #, in the data is read the file.

O: Long - # offset in the area.

A: Long - Number of bytes to be read.

Result: Long - the number of bytes that were read in error 0

Faster and more convenient, you can load a file is no longer good. No Assign, FileMode, open and close more.

From the File S A bytes are loaded into the area B + O. It is loaded in the mode of "read only".

Example:

$ text = "File Name"

ReadFileFast (addr ($ text), area #, 0, & bytes)

ReadFilePieceFast

ReadFilePieceFast (S, B, O, A, P)

Fast reading of a portion of a file in one area.

P: pointer of a string with the name of a file.

B: Long - range #, in the data is read the file.

O: Long - # offset in the area.

A: Long - Number of bytes to be read.

P: Long - Number of bytes to skip from the beginning of the file S.

Result: Long - the number of bytes that were read in error 0

See description

ReadFileFast (), but with the difference that ReadFilePieceFast () part in the

Center can not read or end of a file. Front Related information can be skipped.

Imagine, you want to read just a few bytes of a large file, but all are back in

the file (MP3 files for, for example, Why, then load the whole file?

$ text = "File Name"

ReadFilePieceFast (addr ($ text), area #, 0,8,1600000)

The example loads 8 bytes a large file to an area where the first skipped 1.6 MB

will.

ReadWatch

ReadWatch ()

Determines the number of milliseconds since the last call of

Start Watch () are passed.

The stopwatch is needed at the end of the program will not be released again!

Results: Long - the number of milliseconds that have elapsed since the last call to start Watch ().

Example:

Start Watch ()

...

... 'Here Profancode stands

...

x = Read & Watch ()

print Str $ (x &) + "milliseconds are now gone."

Replace

Replace (Q, A, Z, S1, L1, S2, L2)

All occurrences of the string S1 is in a text or data field is replaced by S2. Does it

50

Secular how's "Translate $ ', but on any great strings or Fields are applied.

Replace () is still working to incredibly fast!

Q: Long - the source pane

A: Long - the size of the data area in Q (number of bytes)

Z: Long - Target Area

S1: String containing the search text

L1: Long - length of pattern string in bytes

S2: String with the Ersetzentext

L2: Long - Ersetzentext length of the string in bytes

Result: Long - the size of the newly generated text in the data area Z (number of bytes).

Replace () works CaseSensitive, uppercase and lowercase letters are therefore treated separately.

This now can program each a find / replace - function for its text or data.

What we need are two data sections, one with the source Q and, later in the target text is generated (Z).

First, we need to know how big the target text will be all. This helps us

Count string ().

The following example shows how large parts of a text can be exchanged.

For example (from Komplettbeispiel for Secular 7):

'# Is in range to a text file loaded. In this text should all points (the

Punctuation is meant to be) "the clear" transformed (point) ". The

Target text is thereby naturally bigger and then saved as' file.

New & Declare, area #, # Range2, length &, & LENGTH2, and l1, l2 &, $ text1, $ text2, filename

$, x &

$ I Prospeed_Funktionen.inc

New & usedll = ( "ProSpeed.dll)

SetTrueColor 1

Cls

'*** Example: laden text file

filename $ = "Test.txt

length ($ filename & = FileSize)

# dim area, length & +1

x & = ReadFileFast (addr (filename $), area #, 0, length &)

Print & Str $ (x &) + "bytes read."

text1 $="." 'Search text here replaced "." through

) $ text2 = "(point" "the Ersetzentext) (point."

@ l1 & = Len ($ text1) 'Length of pattern

I2 & @ = Len ($ text2) 'Length of Ersetzentext

x & count = string (domain #, 0, & length, addr ($ text1), & l1) 'counting how often the search text appears in the text

& = & LENGTH2 determine length - (x & & * l1) + (x & & * I2) 'data length of the new area

Dim Range2 # LENGTH2 & +1

x & = Replace (domain #, & length, convert Range2 #, addr ($ text1), & l1, addr ($ text2), l2 &) 'Text

Dispose range # 'The newly created data are now

Dim range #, LENGTH2 & +1 "in Range2 #.In general, our main program

CopyMemory (Range2 #, 0, sector #, 0, LENGTH2 &) 'his data, but always worked in area #.

Dispose Range2 # 'So we should get the newly created

Data also re-copy 'to an area called the area #.

'Range2 # we no longer need.

$ filename = "test2.txt"

x & = WriteFileFast (addr (filename $), area #, 0, LENGTH2 &)

Print & Str $ (x &) + "bytes written."

WaitInput

New & freedll

End

Replacetabs

Replacetabs (Q, Z, A, L)

Converts all TAB's (Chr $ (9)) in Q by a certain number of spaces.

Q: Long - the source pane

Z: Long - Target Area

A: Long - Number of bytes in the source area crawler

L: Long - Number of spaces per tab to be used

Result: Long - number of spaces that were used in total.

A logical use for Replacetabs () would forAs the text of an editor.

The source area is then the original text, then lands in the target area, the new text with spaces.

A would be the length of the old text. When L is determined by how many shared spaces is a tab.

To calculate how big the target area in general Z must be dimensioned to provide

Count bytes () at.

Example:

spaces = 8 & '8 spaces per Tab

& length = 100000 'size of the text in area #

x & = (count bytes area #, 0, length &, 9) 'tab's count, Chr $ (9)

newlenght = length & & + (x & * (space & -1)) 'New Length =' Old Length + (Hasty's tab * (number of spaces -1))

Dim newbereich #, newlenght & +1

Replacetabs (area #, # newbereich, length &, & spaces)

'The new text is now available in # newbereich area and has the length & newlenght.

Rotate

Rotate (F, X, Y, B1, B2, G, K)

Rotates an image around any axis (0-359 degrees).

Q: Long - Handle of the target bitmap (HDC) or 0

X: Long - X offset to the screen

Y: Long - Y offset to the screen

B1: Long - one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (background image)

B2: Long - Handle with a generated PngToFX (), InitFX () or CreateFX () byte array (image to be rotated)

G: Long - angle (0-359 degrees)

K: Long - Copy mode

Result: Long - 0

A rotated graphic is placed on the screen (or rotated only in memory). X and Y to indicate, at

which position the rotated image is placed on the screen. The size of the rotating

Rectangle is derived from the size of the bitmap that is specified in InitFX () / CreateFX (). Corners,

leave this rectangle will be clipped.

The rotated image is automatically centered in the rectangle, which is very handy.

For F can be either one of the most profane bitmaps (usually% HDC) can be specified or associated with

Produced LoadFileImage () / CreateImage () was. Is passed, however, for F 0, then the function is indeed

executed, but not placed on the screen.

Before Rotate () can be used, must be a preparation with InitFX () have taken place.

In the copy mode, only the values 0 and -1 are allowed. Copy mode is selected as the -1, then

the color of the upper-right pixel of the image to rotate selected as a transparent color, in contrast

to the original profane transparent mode where the transparent pixels will be selected on the left below. Any

Areas in the image can then be made as transparent.

It will not change any data in the byte arrays B1 and B2 by calling this function.

InitFX & array1 = (& background)

array2 = InitFX & (& photo)

'*** Can picture 360 times in one-degree rotation increments

WhileLoop 359.0, -1

     Rotate (% HDC, 100,50, & array1, array2 &, & loop, 0)

Wend

FreeFX (array1 &)

FreeFX (& array2)

Rotate180

Rotate180 (F, X, Y, B)

Rotates an image 180 degrees.

Q: Long - Handle of the target bitmap (HDC) or 0

X: Long - X offset to the screen

Y: Long - Y offset to the screen

B: Long - one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (source bitmap)

Result: Long - 0

The graphics of the screen is rotated 180 degrees. X and Y enter the upper left corner to rotate

Surface on. The size of the rectangle resulting from the size of the bitmap in InitFX () / CreateFX ()

was specified.

For F one of profane can either be specified or a bitmap, with LoadFileImage () /

CreateImage () was created. If passed, but for F 0, the function will be executed but

not brought to the screen.

Before the function can be used, must be a preparation with InitFX () have taken place.

The data in the byte array B are changed by calling this function.

Rotate180 () is faster than Rotate () and should be preferably applied at an angle of 180 degrees

= array & InitFX (exhdc &) 'Handle (byte array) to create a bitmap

Rotate180 (% HDC, 0.0, array &)

FreeFX (array &) 'later release

RotateImage

RotateImage (Z, X1, Y1, B, H, Q, X2, Y2, W, K)

Turns parts of an image or the image on the screen or in a different picture. The rotation is in degrees (0-359).

Z: Long - Handle of the target bitmap forSecular as the main window

X1: Long - left coordinate of the destination bitmap

Y1: Long - the upper coordinate of the destination bitmap

B: Long - Width of the rectangle to be copied

H: Long - height of the rectangle to be copied

Q: long - Trade of the source bitmap

X2: Long - left coordinate of the source bitmap

Y2: Long - the upper coordinate of the source bitmap

W: Long - angle (0-359 degrees)

K: Long - Copy mode

Results: Long - 0

The screen section of the source bitmap starting at X1, Y1 of a width of W pixels and a height

has H pixels, then the position X2, copied Y2 bitmap into the target at an angle W. The last parameter

determines the

Copy Mode.

The rotated image is automatically centered here, which is very handy.

In the copy mode, only the values 0 and -1 are allowed. Copy mode is selected as the -1, then

the color of the upper-right pixel of the rectangle to copy the source bitmap as the transparent color

chosen, as opposed to the original profane Transparent mode is where the transparent pixels selected on the left below.

RotateImage () is working very slowly because of the Get / SetPixel ()-based technology. This GetPixel () is

the big brakes, the sine and cosine passages, and the conversion of radians for angular measure

in assembler been implemented by tables, which gives a breathtaking speed, because

GetPixel () but not much use.

For Precalculating small rotating sprite animations in the program forB. is RotateImage () but

very good. To rotate large images should prefer the much faster

Rotate () are used.

Example:

$ text = "Picture.png"

exhdc & Load LoadFileImage = (addr (text $)) 'Image

width = & GetWidthImage (exhdc &) 'width and height of the image

& height = GetHeightImage (exhdc &) identify '

WhileLoop 0,359,1 'image in 360 steps

RotateImage (% HDC, 200,100, and wide, turn around & height, & exhdc, 0,0, & loop, 0) 'one complete'

Wend

RotateMe

RotateMe (B, O, A, R, F)

A function to allow data in a field (or string rotation) to.

B: Long - pointer to a storage area (or string)

O: long - Offset (address) for B

A. Long - Number of bytes to be rotated

R: Long - as many bytes Rotate

Q: Long - flag, 0 = rotate right / rotate left 1 =

Results: Long - 0

This data can be moved to a storage area to the left or right. Data

rear (or front) from the specified memory "fall out", are (front or rear) reattached.

The best way to demonstrate some examples:

Example 1:

Clear area #

Long range #, 0 = 111

Long range #, 4 = 222

Long range #, 8 = 333

Long range #, 12 = 444

Long range #, 16 = 555

RotateMe (area #, 0,20,4,0)

Print "Four bytes rotate to the right!"

Print Long (area #, 0)

Print Long (area # 4)

Print Long (area # 8)

Print Long (area # 12)

Print Long (area # 16)

Four bytes to rotate to the right!

555

111

222

333

444

Example 2:

Clear area #

Long range #, 0 = 111

Long range #, 4 = 222

Long range # 8 = 333

Long range #, 12 = 444

Long range #, 16 = 555

RotateMe (domain # 0,20,4,0)

Print "Now, four bytes to the left to rotate!"

Print Long (area #, 0)

Print Long (area # 4)

Print Long (area # 8)

Print Long (area # 12)

Print Long (area # 16)

Now, four bytes to rotate to the left!

222

333

444

555

111

Example 3:

(The contents of a string is rotated by 10 characters (bytes) to the right, very nice, a Textscrolling

to program!)

$ text = "This text is a sample text."

RotateMe (addr ($ text), 0, len (text $), 10,0)

Print text $

Sample text.This text is a

Rustle

Rustle (F, X, Y, B)

Creates a noise on the screen (or part of it) similar to a television without Sendeempfang.

Q: Long - Handle of the target Bitmap (HDC) or 0

X: Long - X offset to the screen

Y: Long - Y offset to the screen

B: Long - one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (source bitmap)

Result: Long - 0

The graphics of the screen noise. X and Y specify the upper left corner, where the noise from the screen

aims. The size of the rectangle, it follows from rushing to the size of the bitmap in InitFX () /

CreateFX () was specified.

For F one of profane can either be specified or a bitmap, with LoadFileImage () /

CreateImage () was created. If passed, but for R 0, the function will be executed but

not brought to the screen.

Rustle () is pretty fast and works in real time. Generally, the smaller the area, the faster working Rustle ().

Before the function can be used, must be a InitFX preparation with () have taken place.

The data in the byte array B are changed by calling this function ..

= array & InitFX (exhdc &) 'Handle (byte array) to create a bitmap

WhileLoop 256

Rustle (% HDC, 0.0, array &)

EndWhile

FreeFX (array &) 'later release

SaveFX

SaveFX (B, S, F)

Saves a byte array as a bitmap image file that has pictures are saved but only as bmp files.

B: Long - Handle one by

PngToFX (), InitFX () or CreateFX () generated byte arrays

S: Long - pointer to a string with the filename of the file to be saved for.

Q: Long - flags for file format

Result: Long - Number of bytes that was written into the file in error 0

Now it is possible to save with profane images that are larger than a maximum of 2000 x 2000 pixels.

All images up to a size of 32768 x 32768 can be stored.

As flags exist so far:

0 = Bmp file

Example:

$ text = "picture.bmp"

= array & InitFX (exhdc &) 'Handle (byte array) to create a bitmap

SaveFX (array &, Addr ($ text), 0)

FreeFX (array &) 'later release

SaveImage

SaveImage (H, S, F, P)

Saves an image (HDC).

H: Long - HDC of the image / bitmap

S: Long - range with the file name or pointer to a string with the file name

Q: Long - flag which storage format should be used

P: Long - parameters for various memory processes

Results: Long - 1, where errors 0

.

The image with the HDC H will be stored in a file named P.

F selects the format in which the image will be saved.

So far, there are the following values for F:

0 = bmp format

1 = jpg format

Save (If F is a = 1. Jpg), then can determine the quality of the image with P. These are

Values 1 to 10

The higher the value of P is, the better the quality. I recommend a value of 8 used.

If F = 0 (Save as. Bmp), then P has no meaning and should be 0.

The Jpg storage based on a dll by Andreas Miethe, written in PureBasic. It was me

kindly made available. Thanks, Andrew

(Mail: andreas@andreas-miethe.de / Webpage:

http://www.ampsoft.de/index.htm

)! SaveToMemoryFXFX

SaveToMemoryFXFX (B, M, F)

Copies a byte array as a bitmap image file in a storage area. Kinda the reverse function of

LoadMemoryImage ().

B: Long - Handle one by

PngToFX (), InitFX () or CreateFX () generated byte arrays

M: Long - pointer to a memory area in which the data will be copied.

Q: Long - flags for file format

Result: Long - Number of bytes that were copied to M, with error 0

For further explanations please call

SaveFX () read.The difference between SaveFX () and

SaveToMemoryFXFX (is), here the data is not stored in a file, but in a storage area.

Example:

= array & InitFX (exhdc &) 'Handle (byte array) to create a bitmap

x & = GetWidthImage (exhdc &) 'width and height of the Hdc's exhdc &

y & = identify GetHeightImage (exhdc &) 'and memory for

SaveToMemoryFXFX ()

Dim range #, (x * y * 3 & &) 'Reserve: 3 * width * height

SaveToMemoryFXFX (array &, area #, 0)

FreeFX (array &) 'later release

SEMITRANS

SEMITRANS (F, X, Y, B1, B2, P)

Mixes two different pictures into one, this is a percentage indicating the transparency of each

Picture taken (semi-) transparent fade.

Q: Long - Handle of the target bitmap (HDC) or 0

X: Long - X offset to the screen

Y: Long - Y offset to the screen

B1: Long - First one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (1. source bitmap)

B2: Long - Second handle with a generated PngToFX (), InitFX () or CreateFX () byte array (2. source bitmap)

P: Long - percentage, only values from 0 to 100 Use.

Result: Long - 0

The graphics of images B1 and B2 are combined taking into account the percentage P to F.

It then looks as if both graphics transparent. The background is but erased.

If they want to combine the background along with an image, they must have a

corresponding copy of the background work, which is used for B1 or B2.

X and Y specify the upper left corner where they have placed both images. The size of the display

Rectangle is derived from the size of the bitmap that InitFX was specified in () / CreateFX (). The size

of B1 and B2, but must always be the same size!

For F one of profane can either be specified or a bitmap, with LoadFileImage () /

CreateImage () was created. If passed, but for R 0, the function will be executed but

not brought to the screen.

SEMITRANS () is not quite as fast as the other graphic filters, but works with a 800 MHz

Even with large computer screens in real time. Generally, the smaller the area, the faster

this function works.

Before the function can be used, must be a InitFX preparation with () have taken place.

The data in the byte arrays B1 and B2 are not changed by calling this function. Rather

internally with a third storage area worked. SEMITRANS () will be in effect only in a loop

to show if the percentage change.

Note the set is still too Windows graphics mode. Thus, not every increase of 1 percent

Effects in any mode.

For example, in 16 bit mode only 6:25 per cent of all a change of color is made because only 16

different shades for each color can be used, 16x16x16 for red-green-blue. Only

The 32-bit mode (and on some video cards and the 24-bit mode) to within 1 percent levels

are superimposed. This is work for their programming, but regardless, it is on all graphics

Systems that not only is every gradation visible everywhere.

Example:

An image will appear quite soft in the existing background image.

fxhandle1 & CreateExtImage = (% hdc, 640.480) 'Handle 1 produce: empty bitmap

$ name = "picture.bmp"

fxhandle2 & LoadFileImage = (addr ($ name)) 'handle 2: Load image, such640x480 as large

Paint Image (fxhandle1 &, 0,0,640,480,% HDC, 0,0,0) 'Content of the handle 1 to Profanfensters

bytearray1 & = generate InitFX (fxhandle1 &) 'byte array to handle 1

bytearray2 & = generate InitFX (fxhandle2 &) 'byte array to Handle 2

WhileLoop 100

SEMITRANS (% HDC, 0.0, & bytearray2, bytearray1 &, & loop) 'The picture is displayed in 100 steps in the' background image

Wend

FreeFX (bytearray1 &) 'byte array 1 unlock

FreeFX (bytearray2 &) 'byte array 2 unlock

FreeImage (fxhandle1 &) 'Handle 1 unlock

FreeImage (fxhandle2 &) 'Handle 2 unlock

SetBackAutoCollision

SetBackAutoCollision (H, M, F, P1, P2, P3, P4, P5, P6, P7, P8)

Automatic background sprite collision query with many features.

H: Long - one with a handle

InitSprite () generated sprites

M: Long - Handle a special loaded with LoadFileImage () mask bitmap

Q: Long - Flag

P1: Long - 1 Parameter (used by some flags, otherwise 0)

P2: Long - 2 Parameter (used by some flags, otherwise 0)

P3: Long - 3 Parameter (used by some flags, otherwise 0)

P4: Long - 4 Parameter (used by some flags, otherwise 0)

P5: Long - 5 Parameter (used by some flags, otherwise 0)

P6: Long - 6 Parameter (used by some flags, otherwise 0)

P7: Long - 7 Parameter (used by some flags, otherwise 0)

P8: Long - 8 Pointer to a sound that, with

DSoundLoad () was loaded, otherwise 0)

Result: Long - 0

A new and powerful function. Finally, a real collision of a sprite with the background is

feasible, and also responds automatically be charged without the main program ...

The parameter 8 (not depending on the flag) are a pointer to a buffer library in the with

DSoundLoad ()

a wave file (.Wav) was loaded. In a collision, then played a sound effect.

In any case, we need for M is a special mask bitmap, preferably one copy of the mask

Background. This should be two colors (1 bit black and white picture).

All places in the background that should be accessible from the sprite must be painted white in color.

All other points in the background, the sprite may not enter, have characterized black

be. In this case a collision occurs and the background sprite is not there hingelangen (from

ProSpeed 2.6 were exchanged, the two colors to be compatible with mask bitmaps for other

ProSpeed functions, such, for example,

FINDPATH ()).

Background bitmap (left): The three walls are not of Sprite

are crossed, everything else well.

Mask bitmap (right): Everything that is white, can be crossed, the

black areas (not available for the walls).

For F more flags to choose from, which can not be combined.

0 = No auto collision with this sprite to check.

1 = sprite stops when it touches a non passable surface.

2 = Sprite is drawn like a rubber ball into another logical direction.

3 = As 2, but Sprite has a constant urge to get up (hopping ball up)

4 = As 2 but Sprite has a constant urge to go to the right (Hoppel ball to right)

5 = As 2 but Sprite has a constant urge to get down (fluffy ball down)

6 = As 2, but Sprite has a constant urge to go left (hopping ball to the left)

7 = sprite through a new animation and will be deleted after

For the following flags, they must provide valid parameters (P1-P4):

Flags 2 to 6:

Get P1 = Movepunkts to the left corner of the sprite in a reversal want (0 is best).

Get P2 = Movepunkts to the upper corner of the sprite in a reversal want (0 is best).

P3 = go right to the corner of a Movepunkts the sprite to a reversal will.

P4 = get to the bottom corner of the sprite Movepunkts a reversal will.

Flag 7 (see also

SetSpriteAnim):

P1 = X position (offset) in the sprite bitmap that can be found at the desired sprite graphics

P2 = Y position (Offset) in the sprite bitmap, can be found at the desired sprite graphics

P3 = width of sprite

P4 = height of the sprite

P5 = number of sprites in the animation. The different sprite data of an animation must be adjacent and all the same width and height

P6 = With this picture to start the animation (starting from 1 and not from zero).

P7 = speed at which the animation runs, the lower, the faster (1 = very fast)

Example of a rubber ball collision query (flag 2) with Sound:

SetBackAutoCollision (& sprite, mask &,

2,0,0, GetWidthImage (& mask), GetHeightImage (& mask), 0,0,0, & buffer1)

ProSpeed In the demo, there's the source code

FA_SetBackAutoCollision.prf

That this function very well demonstrated.Four

Sprites (ball) whiz through a maze-like background.

The balls used for the flag F 2nd In an additional sprite-sprite collision

was omitted from list of reasons.

The source code can easily be experimented with.

SetBytes

SetBytes (V, A, S)

Write an unlimited number of arbitrary bytes) in an area (with dummy function.

V: range variable

A: Long - Offset Address

S: string with input instructions

Results: Long - Number of bytes that have been edited.

This command is very elegant it possible to fill a field with arbitrary values.

An example would be:

$ text = "4,6,8,10,12,14,16,18, *, 22,24,26 ,*,*, 32.34"

SetBytes (area #, 0, addr ($ text))

The first line generates the input instructions. The values inside the quotation marks are

actual data to be written in the area. If you plan on so many levels

write once, as they like.

"4,6,8,10,12,14,16,18, *, 22,24,26 ,*,*, 32.34"

The asterisk (*) is a dummy value, at this point the original values of the area will not be overwritten.

The above commands would in an empty area (only zeros) to write the following into it.

Value: 4 6 8 10 12 14 16 18 0 22 24 26 0 0 32 34

Three zero-values have not been overwritten then.

The little detour to the data input through a string / second area could not be avoided, unfortunately, because

Secular maximum of 15 parameters to DLL's can send and the amount may not even be variable.

SetCollideUnknownSprite

SetCollideUnknownSprite (H1, H2, H3, H4)

A specification for

CollideUnknown ().If there are very many collisions must be expected to

be the number using SetCollideUnknownSprite (limited to one to four sprites).

H1: Long - one with a handle

InitSprite () generated sprites or 0

H2: Long - one with a handle

InitSprite () generated sprites or 0

H3: Long - one with a handle

InitSprite () generated sprites or 0

H4: Long - one with a handle

InitSprite () generated sprites or 0

CollideUnknown () creates a list of all currently held collisions.

Sometimes, however, only interested in the collision of one or more main sprites. Collisions

"Enemy sprites" with each other (egAs water elements, or sprites, as a foreground overlay

be used) is not always interesting and a complex collision analysis would disrupt the Spielfluß.

In this case, one or more sprites can be identified, involved in a Sprite-sprite collision

must be if they are to be provided by CollideUnknown (). All other collisions are filtered out.

If passed SetCollideUnknownSprite (0,0,0,0), then CollideUnknown () back to work as usual.

SetCollideUnknownSprite (held &, & weapon, 0,0)

SetLongs

SetLongs (V, A, S)

Write an unlimited number of arbitrary Longs) in an area (with dummy function.

V: range variable

A: Long - Offset Address

S: string with input instructions

Results: Long - Longs number that have been edited.

Example:

$ text = "4,6,8,10,12,14,16,18, *, 22,24,26 ,*,*, 32.34"

SetLongs (area #, 0, addr ($ text)

This command is very elegant it possible to fill an area with any long-terms.

A detailed description can be found under

SetBytes, only the issue here, at Longs. SetMouseRect

SetMouseRect (X1, Y1, X2, Y2)

Limits the movement of the cursor to the specified coordinates.

X1: Long - New X-Position the mouse pointer

Y1: Long - New Y position of the cursor

X2: Long - New X-position of the cursor

Y2: Long - New Y position of the cursor

Result: Long - TRUE or in error 0

This function determines the area of the screen within which the mouse must be moved.

Areas outside of this rectangle can not reach the user with the mouse. Suitable

hervoragend for games to keep the pointer in the menu area and not forAs on the court.

At the end of the program, baseline data should however be re-established by:

SetMouseRect (0,0,% maxx, maxy%)

SetMouseXY

SetMouseXY (X, Y)

Place the cursor at the position X and Y.

X: Long - New X-Position the mouse pointer

Y: Long - New Y position of the cursor

Result: Long - TRUE or in error 0

This function is useful for a certain kind of mouse control, such asB. 3-D games, or

Scroll games are used. For this purpose they put the cursor over the middle of their window. The pointer may

to not be visible (

ShowCursor 0).

Before they are now using the mouse kept recurring in the middle of their window, they ask the X

and Y position of the cursor from (

mausx%,% mausy) and can thus learn how far the user

moves the mouse pointer in the meantime. These values can add up and they have so very

sensitive mouse control.

SetMouseXY (100.200)

SetPixelEffect

SetPixelEffect (Z, R, X, Y, P, S, H, F, A, M, L)

This function starts a pixel effect.

Z: Long - Handle of the HDC's, in which the pixels should be drawn, most probably HDC%

R: Long - 0, or handle of the HDC's, which is taken for the restoration of the pixels, suchB. HDC2%

X: Long - X-position of the effect

Y: Long - Y position of the effect

P: Long - parameters for color mode (M)

S: Long - Start spreading the pixels (1 - 160)

H: Long - intensity of the pixel output (3 to 31)

Q: Long - Gravity direction (dip direction of the pixel)

A: Long - Number of pixels (3 - 1000)

M: Long - the pixel color (not color!)

L: Long - life of the pixels (10 --

300)

Result: Long - 0

It is a pixel effect (mostly run well, an explosion). First, however, have the pixel effects with

InitPixelEffects ()

be initiated (only once, not for each pixel effect!).

Z is the issue HDC) (window, probably mostly% HDC.

R is the restoration HDC (forB.% HDC2 or produced with ProSpeed HDC). If R = 0, then

pixels are all set simply restored with black.

X and Y specify where HDC is positioned in the Z effect. Here, a certain start scattering S

made so that all pixels not start directly at position XY.

The severity of an effect is adjusted by H, the higher the value, the faster moving the pixels.

After some time, a gravity begins to affect the pixel. This may, with the F

Direction of gravity can be set:

0 = no gravity.

1 = gravity allows the pixels to the right "fall".

2 = gravity makes the pixels towards the bottom "fall".

3 = gravity makes the pixels left to fall ".

4 = gravity makes the pixels falling upwards ".

The number of pixels is specified by A. These are not all pixels simultaneously, but with a little delay.

The lifetime of the pixel is set to L, by the time they go out.

The color pixels inm effect is set in M. So far, there are three options:

0 = The initial color of the pixel is set at P. Then the pixels are darker and darker, until they are completely black (blanking mode).

1 = The color of the pixel is set at P (monochrome mode).

2 = The pixels are flashing) in random colors (random mode.

A pixel effect is completely finished when the life of all pixels has ended. The finished effect Pixels

will no longer be handled in the thread.

Currently, 256 different pixel effects may occur simultaneously (as long as enough processor time is available)!

Depending on the data, structured or random pixels explosions can be generated, large or

small, heavy or slow. Play them quiet times with the values.

A fine example of the application are exploding sprites, the sprite will be deleted and in its

Start position of an explosion, looks very professional!

InitPixelEffects ()

SetPixelEffect (% HDC, 0,200,200, $ FFe020, 24,13,2,250,0,120)

...

DeInitPixelEffects ()

SetSpriteAnim

SetSpriteAnim (H, X, Y, B, H, AF, SA, GA)

Sets the sprite with the handle H is a new animation.

H: long - with handle of a InitSprite () generated sprites

X: Long - X Position (offset) in the sprite bitmap that can be found at the desired sprite graphics

Y: Long - Y position (offset) in the sprite bitmap, can be found at the desired sprite graphics

B: Long - Width of the sprite

I: long - Height of the sprite

AF: long - number of sprites in the animation. The various data of a sprite animation must be adjacent and all the same width and height

SA: Long - With this picture to start the animation (starting from 1 and not from zero).

GA: long - speed at which the animation runs, the lower, the faster (1 = very fast)

Result: Long - 0

More info about the animation of the sprites below

InitSprite ().

SetSpriteAnim (& sprite, 0,0,24,18,4,1,8)

SetSpriteAnimMode

SetSpriteAnimMode (H, M)

Specifies whether an animation is played again from the beginning (loop) or stops with the final animation phase.

H: Long - one with a handle InitSprite () generated sprites

M: Long - the mode of animation. 0 = front / 1 stop

Result: Long - 0

If they give as Mode 0, starts the animation of the sprite again from scratch. Enter

However, 1 in, then the animation stops with the last picture.

Whether the animation has been stopped, they may, by

Query GetSpriteAnimModeStatus ().

This function is useful for hervoragendFor example, exploding spaceships. The explosion animation

they can be run in mode 1 and the last image is then an empty Sprite. Once

GetSpriteAnimModeStatus ()

has recognized that the explosion is over, delete the sprite simply by

DeleteSprite ()

.

The default mode for animations is always 0 (loop).

SetSpriteAnimMode (& sprite, 0)

SetSpriteAnimMove

SetSpriteAnimMove (H, R, X, Y)

Defines an animation for a particular movement direction of the sprite with the handle H.

H: Long - one with a handle InitSprite () generated sprites

R: Long - direction that moves the sprite.

X: Long - X Position (offset) in the sprite bitmap, can be found at the desired sprite graphics

Y: long - Y position (offset) in the sprite bitmap, can be found at the desired sprite graphics

Result: Long - 0

A powerful new feature.

For each direction that moves a sprite, you can now have a separate animation sequence set

will. Thus sprites can be created that are independent of the main program in every direction

and move animated are always different, forAs a person running around on the screen.

For the different directions the following figures are provided.

0 = stop

1 = upper right

2 = right

3 = bottom right

4 = bottom

5 = bottom left

6 = left

7 = top left

8 = Up

The number and the expiry of the different animation steps are not changed, only X and Y Offset

in the sprite bitmap are reset. By calling

SetSpriteAnim () deletes all phases of movement again.

Example:

kraehe InitSprite & = (& sprite,% HDC, Fensterkopie1 &, & Fensterkopie2, 0,192,64,64,2,1,16,600,0,2,1)

SetSpriteAnimMove (kraehe &, 0,0,0)

SetSpriteAnimMove (kraehe &, 1,192,64)

SetSpriteAnimMove (kraehe &, 2,0,64)

SetSpriteAnimMove (kraehe &, 3,192,192)

SetSpriteAnimMove (kraehe &, 4,0,128)

SetSpriteAnimMove (kraehe &, 5,192,128)

SetSpriteAnimMove (kraehe &, 6,0,192)

SetSpriteAnimMove (kraehe &, 7,192,0)

SetSpriteAnimMove (kraehe &, 8,0,0)

SetSpriteCage

SetSpriteCage (H, X1, Y1, X2, Y2, XN, YN)

Automatically checks whether a sprite has moved from a rectangular area out, if so, will

Set sprite to a new location and stopped his movement.

H: Long - one with a handle InitSprite () generated sprites

X1: Long - Left position of the rectangular area

Y1: Long - Upper position of the rectangular area

X2: Long - right position of the rectangular area

Y2: long - Lower position of the rectangular area

XN: Long - New X-position, is set to the sprite when the rectangle

abandoned

YN: Long - New Y-position is set to the sprite when the rectangle was abandoned

Result: Long - 0

This function is executed within the sprite thread (ie, automatically). Each run is then

tested whether the sprite with the handle H can be made out from under the X1, Y1, X2, Y2 specified rectangle

has moved. If so, it is set to its new location XN, YN, and stopped its movement. To

make them function again invalid, must X1, Y1, X2, Y2 be specified with zero, forWith B.

SetSpriteCage (handle &, 0,0,0,0,0,0).

A meaningful use would it be if spaceships firing shots. SetSpriteCage () then limits the

Shots on the visible portion of the screen. Get the shots from the screen, then their

Position automatically on suchB. -40, -40 set. Now might be a

DeleteAllXSprites (-40) or

DeleteAllYSprites (-40)

in Profanprogramm automatically delete all the shots that are no longer visible.

SetSpriteCage (& sprite, 0,0,1024,768, -40, -40)

SetSpriteFixMode

SetSpriteFixMode (H, M)

Sets the drawing mode for the sprite with the handle H.

H: Long - one with a handle InitSprite () generated sprites

M: Long - character mode, 0 = normal / 1 = unmoved, not animated sprite

Result: Long - 0

Normally, this mode is 0 You can put it but this function to 1. This makes the

Sprite not redrawn, so it makes a break and consumes almost no system more time.

SetSpriteFixMode () is only interesting for sprites, which are not moving, not animated and not by

other sprites are superimposed. Or for sprites, which just are not visible!

All other functions can still be used for this sprite, suchAs the

Collision functions. Once another sprite touches our "fixed" Sprite, they can do it with

SetSpriteFixMode (& sprite, 0)

life again "to life" or delete DeleteSprite ().

One such application would beAs a breakout game, where many pieces unmoved wait on it until it shoots a ball.

See also

GetSpriteFixMode () and VisualTableFix (). SetSpriteLayer

SetSpriteLayer (H, L)

Sets) for a sprite a new presentation layer (Layer.

H: Long - one with a handle InitSprite () generated sprites

L: Long - New Layer number

Result: Long - 0 or greater, with error -1

The layer of the sprite H will be reassigned. The larger L is, the farther the sprite to H

other sprites in the foreground.

L shall not be less than 1 And L can not be greater than the value determined by CountAllSprites ()

can be, so the maximum number of existing sprites.

Important! The Sprite, which has been generated as the first, must not and can no other presentation layer

get. There always remains the sprite that can be overlaid by any other! It has a special status.

SetSpriteLayer (sprite6 &, 3)

SetSpriteMovingMode

SetSpriteMovingMode (H, M)

Sets for the sprite with the handle H to another movement mode () normal, or line mode.

H: Long - one with a handle InitSprite () generated sprites

M: Long - Mode, 0 = normal / 1 = straight line

Result: Long - 0

Until now moved to its new destination point sprites by as quickly as possible, the X and YAchse

the new point reached. Most came from this is an angular trajectory. Of the

Coordinates 0.0 to 100.50 for) B (at the same speed in both axes, the first by Sprite

fly down the right. First, it reaches the Y screen.Position. From now on, it flies the rest of the

Only route to the right.

From ProSpeed 2.1 they have the opportunity to get to the target point sprites so that only one line

would arise, so a direct flight path.

In the mode 1 as the speed of X and Y only requires the value of X, ie

SetSpriteSpeed (handle &, 4,1) would be for

Setting a sprite, the speed 4.

Has some limitations, however, the line mode:

1) It should be no direct setting to another position in place (with SetSpritePos).

2) The speed should not be less than 16

The line mode is based on the Bresenham line algorithm, a very fast method to precisely

Lines to be calculated. Nevertheless, it consumes a bit more calculation, of course, as the system time

normal movement mode. The differences are really very low.

SetSpriteMovingMode (& sprite, 1)

SetSpritePos

SetSpritePos (H, X, Y, XN, YN)

Sets the sprite with the handle H is a new position on the screen.

H: Long - one with a handle InitSprite () generated sprites

X: Long - New X-position is put in the sprite (not move) is

Y: Long - New Y position is put in the sprite (not move) is

XN: Long - New X-position, the sprite will move to the next

YN: Long - New Y position, the sprite will move to the next

Result: Long - 0

This function sets the sprite to the new coordinates and produces a simultaneously

MoveSprite ().If only they

new coordinates want, then they put X and Y and also XA and YA on identical values.

SetSpritePos (& sprite, 30,200,30,200)

SetSpriteSpeed

SetSpriteSpeed (H, X, Y)

Sets the sprite with the handle H is a new movement speed.

H: Long - one with a handle InitSprite () generated sprites

X: Long - New speed with which the sprite is moving on the x-axis.

Y: long - New speed with which the sprite is moving on the y-axis.

Result: Long - 0

X and y must always be positive. Negative values are not allowed. A change in the

Direction of movement of the sprite does not reach them by others (or negative) velocity values,

but) only by other target position values (eg with MoveSprite ().

SetSpriteSpeed (& sprite, 4.4)

SetTiles

SetTiles (Q, YT, AX, AY, B, H, M, BM, MX, MY, Z, OX, OY, T, F)

Put a picture (or Level) together, which consists entirely of small particles of graphics (tiles). The arrangement of the

Graphic parts is determined by a Maptabelle.

Q: Long - HDC an image with the various graphics chips

YT: Long - Y offset of Q from which the graphics are (measured in pixels)

AX: Long - Number of tiles that should be copied to the X-axis) (after Z

AY: Long - Number of tiles that should be copied to the y-axis) (after Z

B: Long - width of a tile

H: Long - height of a tile

M: Long - pointer to an area with Mapdaten (forB map #)

BM: Long - Width of Map in Tiles

MX: Long - X-offset in the Mapdaten (M), from where the tiles are to be represented in Z

MY: Long - Y offset in the Mapdaten (M), from where the tiles are to be represented in Z

Z: Long - target HDC, to be copied all affected Tiles

OX: Long - X-offset in the destination HDC (Z)

OY: Long - Y-offset in the destination HDC (Z)

T: Long --

Copy mode

Q: Long - 0, or pointer to an area with the numbers of tiles, which only

should be copied, all the others are not copied

Score: 0

A very powerful feature that relieves the programmer a lot of work and very fast.

However, even a little complicated (15 parameters) see if you understand my Erkärung ...

Q is the pointer to an image with tiles. A tile is a rectangular piece of artwork. Complete Landscape

will be set for various small graphic pieces together, a common practice in games

and memory-saving technique.

Each tile in Q must be equal, and all tiles must lie horizontally nebeneiander. Are allowed

maximum of 256 different tiles, which should be enough forever.

YT indicates at what Y position in the bitmap Q can be found on the graphics chips.

AX and AY ultimately determine the size of a composite image, it is specified how many

Tiles to the right and below should be copied to the destination bitmap Z.

W and H specify the width and height of an individual tiles, it's measured in pixels.

M is the pointer to an area with Mapdaten. In this area, each byte stands for the number of a

Tiles in Q. 0 would be the number of tiles, which is located far left of the bitmap. To the right is

Tile 1, next to Tile 2, Tile then 3, etc

BM indicates how many tiles, the map M wide. If a court so 128x64 would be great, then would have to stand here 128.

MX and MY specify the offset within M, ie the upper-left position from which the map as a graphic

should be displayed.

Z specifies the destination bitmap (HDC) into which to copy the tile graphics. This need not be inevitably% HDC.

OX and OY to give the offsets in Z, ie the upper left corner, from which the tile images to be copied.

T gives the

Copy mode, it's all copy modes may be used.

In F is a field with the numbers of tiles can be specified to be copied. All

other tiles which, although present in the map, but were not listed in the area in F, are

not copied. If for F given a 0, then all the tiles are always copied.

Q Why is it any good? The parameter F is the function SetTiles () considerably

to accelerate suchExample, if figures are to be drawn into a playing field or the landscape of almost 3 --

D elements is assembled. Suppose we have a landscape of grass, water and

tall trees there. In the first call to SetTiles (), the lower parts of the graphic pieces are copied,

therefore, grass, water and the roots of the trees. The trees are much higher than the grass. So be

in a second run (again SetTiles ()) (now the upper part moved slightly upward)

set. Among the trees that is useful in the grass and water but not because of the second run so eh

nothing would be copied. So we determine the second run in R now, the only tree-Tiles

should be copied. Thus we arrive at an incredible speed-profit.

To the end of the range in R to identify the last entry must be 1111th

Here is a small example for the generation of a range in F:

$ text = "2,3,4,9,11,16,17,18,1111"

SetWords (welchetiles #, Addr ($ text))

An area must be in F) is always described with integers (Word.

Examples:

SetTiles (tileshdc &, 25,24,16,32,25, map #, 256, & posx, & posy,% HDC, 0,64,0,0)

SetTiles (tileshdc &, 0,24,16,32,25, map #, 256, & posx, & posy,% HDC, 0.39, -1, welchetiles #)

The beginning of a game based on tile can find it, during the ProSpeed source code:

FA_Tiles.prf. SetTiles5

SetTiles5 (B)

A Secular 5 compatible solution to use on tiles.

Are B: Long - range in which the 15-parameter tiles in a row (as long int) are stored

Result: 0

Secular 5 can only transfer up to 12 parameters to a dll, SetTiles () but has 15 parameters. Therefore

is SetTiles5 () the only way to tiles in "small" Profanversionen use.

What parameters are needed, is on

SetTiles be read ().

The storage area B must be dimensioned with a minimum of 64 bytes.

One example is source ProSpeed.dll be found at the source code to:

FA_Tiles_Profan5.prf SetWords

SetWords (V, A, S)

Write an unlimited number of Words in any one area (with dummy function).

V: range variable

A: Long - Offset Address

S: string with input instructions

Results: Long - Number of Words that have been edited.

Example:

$ text = "4,6,8,10,12,14,16,18, *, 22,24,26 ,*,*, 32.34"

SetWords (area #, 0, addr ($ text)

This command is very elegant it possible to fill an area with any Word values.

A detailed description please visit

SetBytes, only the issues relate to Words. Sharpen

Sharpen (F, X, Y, B)

Exacerbated the colors of the graphics on the screen (or any part thereof). However, in any case the

Reverse effect of blur ().

Q: Long - Handle of the target Bitmap (HDC) or 0

X: Long - X offset to the screen

Y: Long - Y offset to the screen

B: Long - one with Handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (source bitmap)

Result: Long - 0

The graphics of the screen seems to be sharper. X and Y specify the upper left corner, from where the

Screen is sharper. The size of the rectangle resulting from the size of the bitmap in InitFX () /

CreateFX () was specified.

For F one of profane can either be specified or a bitmap, with LoadFileImage () /

CreateImage () was created. If passed, but for R 0, the function will be executed but

not brought to the screen.

Sharpen () is pretty fast and works in real time. From a 600 processor and a large should

Screen liquefy sharpened.

Generally, the smaller the area, the faster working Sharpen ().

Before the function can be applied must be a InitFX preparation with () have taken place.

The data in the byte array B is changed by calling this function ..

= array & InitFX (exhdc &) 'Handle (byte array) to create a bitmap

WhileLoop 256

Sharpen (% HDC, 0.0, array &)

EndWhile

FreeFX (array &) 'later release

SizeImage

SizeImage (Z, X1, Y1, B1, H1, Q, X2, Y2, B2, H2, K)

Copies parts of an image or the image on the screen or in a different picture. The target is

here, contrary to Paint Image (), but variable. Therefore there are 2 more parameters.

Z: Long - Handle of the target bitmap forSecular as the main window

X1: Long - left coordinate of the destination bitmap

Y1: Long - the upper coordinate of the destination bitmap

B1: Long - New Width

H1: Long - New Height

Q: Long - the trade source bitmap

X2: Long - left coordinate of the source bitmap

Y2: Long - the upper coordinate of the source bitmap

B2: Long - Width of the rectangle to be copied

H2: Long - height of the rectangle to be copied

K: Long - Copy mode

Results: Long - TRUE, FALSE on error.

This function is almost identical with

Paint Image ().But can a copy of the bitmap assume any size (B2 and H2).

And when

Copy mode is -1 not allowed!

SizeImage (% hdc, 0,0, & Neuebreite, Neuehoehe &, & ExHDC, 0,0, & width, & height, 0)

SlowDownSprite

SlowDownSprite (H, X, Y)

Slows the movement of a sprite.

H: Long - one with a handle InitSprite () generated sprites

X: Long - slowing down the X-axis

Y: Long - slowing down the Y axis

Sometimes you need sprites, which will move slower than a pixel per frame. The far left

not () with no tricks.

With SlowDownSprite () but this is now no longer a problem.

Now the Sprite HX, Y frames or waits until the sprite is moved back in that direction.

In order for a SpriteExample, by half a pixel per frame (not constructed, visually. In reality, it is once

moved by one pixel, with the next time to move 0 pixels, etc.), must be written:

SetSpriteSpeed

(& sprite, 1.1)

SlowDownSprite (& sprite, 1.1)

Is used for X and Y is a 0, then the original state of this axis is restored.

Smooth

Smooth (F, X, Y, B, M)

Blurs the image, similar to

Blur ().

The blur is a bit softer and a mask bitmap which passages may, within

of the image are determined, affected by the effect. Of course, slower than Blur ()...

Q: Long - Handle of the target bitmap (HDC)

X: Long - X offset to screen

Y: Long - Y offset to the screen

B: Long - one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (source / destination bitmap)

M: Long - one with a handle PngToFX (), InitFX () or CreateFX () generated byte arrays (mask bitmap)

Result: Long - 0

The graphs in B is blurred in the light of the mask bitmap copied to M and F and B ".

X and Y specify the upper left corner where they have placed both images. The size of the display

Rectangle is derived from the size of the bitmap that is specified in InitFX () / CreateFX (). The size

of B and M, but must always be the same size!

For F can be either one of the most profane bitmaps (% HDC% HDC2 ...) are specified, or one with

Produced LoadFileImage () / CreateImage () was. If F = 0, then the blur will be canceled on,

but not shown.

The data in byte array M are not changed by calling smooth (), the data in B, but even.

The mask bitmap M should be a black and white image.

White pixels in the mask bitmap share with Smooth (), which produced in those areas of the blurring effect

should be. Black pixels in the mask bitmap mean that in those areas of the image does not blur

is generated.

SmoothPath

SmoothPath (B, A, O)

This function smooths paths with

FINDPATH () or PixelToMemory () were calculated or the

Program "Pathfinder" by Maurice Kersten (available as shareware creates ProSpeed) were. Curves

edges are rounded and smoothed.

B: Long - pointer to a memory area (range variable), which contains the Wegdaten

A: Long - Number of bytes in Wegdaten in B

O: Long - Specifies how often smooths the path will be

Result: Long - 0

The Wegdaten that are in B are smoothed.

A indicates how many bytes are in Wegdaten in B. Per pair are the coordinates of a X-axis value and

a Y axis value (integer), ie, 2 Integer = 4 bytes.

O give at how often the smoothing is performed, it would be at 1 again. The best smoothing Results

take values of 2-4. Is smoothed, more often, the more the original Wegdaten be falsified.

SmoothPath (area #, 64.4)

Sound

Sound (uses DirectX):

SpriteMovingRect

SpriteMovingRect (H, X1, Y1, X2, Y2)

Build a rectangular boundary of the sprite with the handle H, within which the sprite

moved automatically. Pushes it to a limit, then it automatically changes its direction of motion.

H: Long - one with a handle InitSprite () generated sprites

X1: Long - Left boundary of the sprite

Y1: long - Upper limit of the sprite

X2: Long - limiting the rights of the sprite

Y2: Long - Lower limit of the sprite

Result: Long - 0

A powerful new feature, taken together with

SetSpriteAnimMove () hervoragend suitable fürJump 'Run Games.

Is specified for X1, Y1, X2 or Y2 a -1, then the limit for that direction is again

repealed. It must then be done in pairs, that is always the same for X1 and X2 or

simultaneously for Y1 and Y2. Show only one of four values as -1 is not allowed and leads to mistakes!

SpriteMovingRect (& sprite, 0,0,1024,768) 'sets the limit on 0/0/1024/768

...

SpriteMovingRect (sprite & -1.0, -1.768) 'emphasizes the horizontal boundary again

SpriteMovingRect (& sprite, -1 -1, -1, -1) 'emphasizes the horizontal and vertical limits again

Sprite ScrollMode

Sprite ScrollMode (H, M)

Modifies the behavior of a sprite is active Bildschirmscrolling.

H: Long - one with a handle InitSprite () generated sprites

M: long - Mode, 0 = normal; the sprite coordinates are relative to the zero axis of the background graphic.

1 = new, the sprite coordinates are relative to the zero line of the program window.

Result: Long - 0

In Mode 1 can now realize even sprites, which remain absolutely motionless on the screen

can, no matter how much the background is also scrolled.

ScrollMode Sprite (sprite &, 1)

Sprite Table Mode

Table Sprite Mode (H, M)

Sets the mode by which

MoveSpriteWithTable to work (), either single-mode (m = 1) or loop mode (M = 0).

H Long - Handle with InitSprite a created () sprites.

M: long - Mode, 0 = normal / 1 = table only once work off

Result: Long - 0

The default is the loop mode, the table is executed again from scratch. If tables

COMBINED with

Pathfinding are used, the single-mode, but more useful.

Table Sprite mode (& sprite, 1)

Brake sprite thread

Sprite Thread Brake (M)

Waiting for each sprite, which was copied onto the screen, M milliseconds. This runs the Secular

Main program much faster, the sprite thread will naturally be slower. For not moving sprites

particularly advisable to use sprites as icons (on buttons, toolbar, etc.), but very meaningful.

M: long - number of milliseconds (recommended: 1-10)

Result: Long - 0

Is used for M is zero, then the brake is lifted.

Sprite thread Brake (4)

...

Sprite thread Brake (0)

SpriteToHDC

SpriteToHDC (H)

Copies the current image of the sprite with the handle H) on the screen (and in the two-screen copies.

H: Long - Handle one with InitSprite () generated sprites

Result: Long - 0

A copy of the sprite is firmly anchored at the current coordinates on the screen and is henceforth

Part of the background. The sprite, however, continue to respond as usual.

SpriteToHDC (sprite &)

Stars

Stars (Z, R, L, O, R, U, A, G, F)

Creates a moving star field, where the stars come forward to the viewer. Stars () works

automatically in a separate thread until the function

NoStars (), the star field terminated.

Z: Long - Handle of the HDC's, are drawn to the stars, most probably HDC%

R: Long - 0, or handle of the HDC's, which is taken for the restoration of the star points

L: long - left border of the stellar field (relative to the window)

O: Long - the upper limit of the stellar field (relative to the window)

R: Long - right boundary of the stellar field (relative to the window)

U: Long - lower limit of the stellar field (relative to the window)

A: Long - Number of stars

G: Long - velocity of stars (low = fast)

Q: Long - Flags

Result: Long - On error 0, otherwise address of the thread.

A Stars come flying toward the viewer. The stars come out in the middle of the L, O, R and U

specified rectangle, and then migrate to the edge. With the function

Option stars () can still

subsequently be changed to the center of the star field and the direction / velocity of the stars.

There can be only a star field can be generated simultaneously.

The magnitude of the field, as determined by L, O, R and U, must have at least the size of 320 x 320,

small asterisks are not allowed.

When stars are programmed with sprites, it should be for the value of R Copy 2 (K2)

be specified (see InitSprites).

Is for R indicated a zero, the screen will be restored only with black pixels.

The number of star A should be 100 to 300, higher values otherwise structure the screen too much.

For G values make sense from 2 to 256 to move with the stars at the value 2 fastest. The

optimal value here lies at 12

R these flags are currently available:

0 = Normal mode.

Restore 1 = Only those pixels, the black background color

(RGB (0,0,0) is).

Meaningful only in relation to an HDC of R. The star will only have

drawn, where

a black surface is to cover virtually any other graphics the stars.

Example:

A demo of the stars they see in the source code folder in the file

FA_Stars.prf

Stars (% HDC, 0,0,0,800,600,200,64,0)

Home Watch

Start Watch ()

Starts a stopwatch, whose stand with ReadWatch () can be read.

This clock is especially ideal for measurements during the programming of an application (such as fast

This routine works?)

The stopwatch is needed at the end of the program will not be released again!

Results: Long - 0

Status stars

Status stars ()

This function checks whether a field of stars is still running, or has already ended.

Result: Long - Status of the stellar field

For this result, there are two possibilities:

0 = Sternfeld is still active, or it was not produced any.

1 = Sternfeld has ended.

This feature is very useful when a field of stars via

NoStars () has ended with parameter 3rdAt

Parameter 3 will be moved further all the stars yet, until they disappeared from view, only then

terminates the star field.

StopAllSprites

StopAllSprites (S)

Stop all the sprites and the scrolling background. Just a pause function.

P: Long - Switch parameters: 0 = normal mode / 1 = everything stops

Result: Long - 0

The background stops scrolling, and all sprites to consider if it is specified as a parameter 1st With 0

as a parameter everything goes on as usual.

Watch out they do not invoke the same parameters several times. So always nice OFF ON-OFF-ON-OFF ......

StopAllSprites (1)

...

StopAllSprites (0)

SubWindowStyle

SubWindowStyle (W, S, F)

(To disable one or more) Windows Extended Window flags and flags, and thus changes the appearance of a window.

W: long - Handle of a window (forB. HWnd%)

S: Long - Value (s) for Window-Style (s), or Extended Window Style (s)

Q: Long - flag, which style is used: 0 = Window-Style / 1 = Extended Window Style

Score: 0

This looks like a window can be changed, which is already open. SubWindowStyle ()

shall deliver to the path indicated by S Style. This can have a combination of multiple window

His styles. However, the standard Windows styles may not with the extended window styles

be combined! If they one (or more) extended away Window Style (s) want, then

must be specified for F is 1, for standard Windows styles a 0

Examples:

(1. If the horizontal or vertical scroller AddWindowStyle from the sample away again)

(2. Does the window the ToolWindow style from the AddWindowStyle sample away again)

SubWindowStyle (% hwnd, $ 300000.0) 'EXAMPLE 1

SubWindowStyle (% listbox, $ C00000, 0) 'Example 2

SubWindowStyle (listbox%, 1.1)

SwapSpriteLayers

SwapSpriteLayers (H1, H2)

Swap the presentation levels (layers) of two sprites.

H1: Long - Sprite 1, first with the handle of a InitSprite () generated sprites

H2: Long - Sprite 2, the second one with a handle InitSprite () generated sprites

Result: Long - 0, if an error occurred -1.

The layers of the two sprites H1 and H2 are interchanged. Any meaningful use would be for, for example,

A figure walks past behind a tree, then she goes back and this time runs in front of the tree. So

a spatial field can be created.

Important! The Sprite, which has been generated as the first, can not be swapped. In other

Words, the sprite GetSpriteLayer (...)= the value 1 may not be reversed. It has a special status.

SwapSpriteLayers (sprite1 &, & sprite2)

SwitchTaskbar

SwitchTaskbar (F)

Windows Taskbar can appear or disappear.

Q: Long - Flag

Results: Long - 0

Decrease the window in the Windows taskbar can be switched on and off.

Values for F are:

0 = Disable Taskbar

1 = turn on Taskbar

Tooltip

Tooltip (D, S, W, I)

This can be a dialogue element (button, edit field, etc.) generate a Tootip.

"Tooltip ()" gibts well as procedure "SetTooltip.

F: Long - Handle a control (dialog element)

S: Long - Address of a string with text for the tooltip

W: Long -% (hwnd Handle of the main window)

I: hinstance Long -%

Results: Long - Handle of the generated Tooltip

Tooltips are small text that represents the computer when the mouse stops short of a dialog element.

An installed tooltip needs to be released end of the program again.

button & = @ CreateButton (hwnd%, "end", 200,312,80,20)

$ text = "This button will close the program"

Tooltip (& button, addr ($ text), hwnd%,% hinstance)

If they use the Inc file "Prospeed_Funktionen.inc" offers ProSpeed a tooltip handler

to, because profane knows anyway, two of the parameters, and%% hwnd hinstance.

In this case, they can install a tooltip even easier, the procedure is called "

SetTooltip "(only

Secular use from 7!)

button & = @ CreateButton (hwnd%, "end", 200,312,80,20)

SetTooltip button & "This button exits the program"

VarToLong10

VarToLong10 (V, A, W1, W2, W3, W4, W5, W6, W7, W8, W9, W10)

Writes long values after ten o'clock in a field.

V: range variable

A: Long - Offset Address

W1: Long - the number or variable

W2: long - the number or variable

W3: Long - the number or variable

W4: Long - the number or variable

W5: Long - the number or variable

D6: Long - the number or variable

W7: Long - the number or variable

D8: Long - the number or variable

W9: Long - the number or variable

W10: long - the number or variable

Result: Long - 0

Example:

x = 111 &

& y = 222

VarToLong10 (domain # 0.1465, x &, x & y + &, 27167,5,6, x & * 7, & y, 9.1 * 10)

VarToLong10 (area #, 40 ,...)

VarToLong10 (range #, 80 ,...)

Result Area #:

Address: 0 4 8 12 16 20 24 28 32 36

...

Worth 1465 111 333 2716 7 5 6 777 222 9 10

VarToLong4

VarToLong4 (V, A, W1, W2, W3, W4)

Writes four long values in succession, in an area.

V: range variable

A: Long - Offset Address

W1: Long - the number or variable

W2: Long - number or variable

W3: long - the number or variable

W4: Long - the number or variable

Results: Long - 0

Example:

& x = 111

& y = 222

VarToLong4 (area #, 0.1465, x &, x & y + &, 271678)

VarToLong4 (area #, 16 ,...)

VarToLong4 (area #, 32 ,...)

Result Area #:

Address: 0 4 8 12 ...

Value: 1465 111 333 2716 78 ...

Version

Version ()

Gives some information from the ProSpeed.dll.

Result: None

VisualTableFix

VisualTableFix (B, A, L, O, R, U)

Sets for all sprites, which are located just outside the visible area of the screen that

Fixmode 1st These sprites are no longer drawn constantly.

All the visible sprites are put back into the Fixmodus 0, then drawn again and again.

VisualTableFix make cuts, especially on huge levels, tons of system time!

W: long - pointer to a storage area filled with Sprite handles

A: Long - Number of bytes (!), Which was filled with the memory B

L: Long - Left Margin

O: Long - Top Margin

R: long - RightMargin

U: long - Lower edge

L, O, R and U indicate the visible edge of a level. Assuming that the level is 2000 x 2000

Pixel size, the screen but only 800 x 600 would be, then the values for the four margins: 0 + offset, 0 + offset,

800 + and 600 + offset offset.

B is a memory. This is filled with the Sprite handles affected by the change of Fixmodes

should be.

A indicates the number bytes in B are (note, a sprite handle occupies 4 bytes (long -

Integer )...).

More Fixmode is available at

GetSpriteFixMode to read () and SetSpriteFixMode ().

VisualTableFix (area #, & bytes, scrollX &, & scrolly, scrollX & +800, & scrolly +600)

WaitWatch

WaitWatch (M)

Waits at least M Millisekundenn up since the last call

Start Watch () are passed.

This function is very well suited to synchronize fast and slow computer.

M: long - number of milliseconds (= tausenstel seconds)

Results: Long - 0

Water

Water (F, X, Y, B, H, V)

A great water effect! The graphics of the screen with slight undulations to and fro

rocking. Combined with previously administered FlipY () and Darken () has this feature

Jump & Run feast for the eyes in all games.

In version 3.0 has been completely rewritten.

Q: Long - Handle of the target bitmap (HDC) or 0

X: Long - X offset to the screen

Y: Long - Y offset to the screen

B: Long - one with a handle

PngToFX (), InitFX () or CreateFX () generated byte arrays (source bitmap)

H Long - 0 or pointers to memory with a horizontal wave motion

V: long - starting row of vertical wave motion

Result: Long - 0

The graphics of the screen is like water out gently rocked back and forth. X and Y enter the upper-left

Corner, from where, a "wet". The size of the rectangle resulting from the size of the

Bitmap InitFX was specified in () / CreateFX ().

For F one of profane can either be specified or a bitmap, with LoadFileImage () /

CreateImage () was created. Is passed, however, for F 0, the function will be executed but

not brought to the screen. In this case, the array data is modified directly.

The Call of Water () should not be done too quickly. Only a slow process works

realistic, I recommend an upgrade to 40-48 milliseconds. Before the function applied

may be, must be a preparation with InitFX () have taken place.

The water effect is composed of a horizontal and vertical wave motion of the image.

Is given a zero for H, is a ready default horizontal, and optimized wave (see

below). Otherwise, this parameter expects a pointer to a memory with LongInt. It may

-5 To 5 numbers to be used, and as late detection of a 255 obligation. For the mean wave

these figures that the wave of negative numbers to the left and positive numbers, the wave after sliding to the right

let. The pre-wave looks as Profancode like this:

Long range #, 0 = 0,1,1,3,1,1,3,1,1,3,2,2,2,1,3,3,3,4,3,3,3,3, 4,3,3,3,3,5,3 \

3,2,2,4,2,2,2,2,4,3,3,3,3,3,1,3,3,3,3,2,2,2,1,1,1, 0,0,0,0 \

-1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, -1, -1 , -1 \

255

The length of LongInt sequence does not matter.

V of the vertical wave motion. Here, the programmer, the wave motion can not itself

determine (the danger here would be making a mistake) very large. But it can determine whether

take place at all is a vertical shaft, and if so, at what is scheduled to begin y position this!

Vertical shafts position 0, the movement of water can often look unrealististisch It appears then,

the viewer as if the opposite shore will be flooded. Of quay walls forB. Of course

essential, but not always desired. Here, the programmer is prompted for each image

individually to find the appropriate value. Should be no vertical wave motion, is at V

Just enter a very high value, suchAs simply the height of the image, or -1.

The data in the byte array B are not changed by calling this function, unless F is equal to zero!

Example:

Long range #, 0 = 1,2,3,4,5,4,3,2,1,0, -1, -2, -3, -4, -5, -4, -3, -2, -1,0,255

= array & InitFX (exhdc &) 'Handle (byte array) to create a bitmap

WhileLoop 256

     Water (% HDC, 0.0, & array, area # 40)

EndWhile

FreeFX (array &) 'later release

WriteFileFast

WriteFileFast (S, B, O, A)

Quickly write a file from one area.

S: pointer of a string with the name of a file.

B: Long - range # from which the data is written to the file.

O: Long - # offset in the area.

A: Long - Number of bytes to be written.

Result: Long - the number of bytes that have been written in error 0

Faster and more convenient, you can save a file is no longer good. No Assign, FileMode, Open and Close more.

To file a S bytes from the area B + O to be written. It will write in the mode of "just"

stored. If a file already exists the same names, it is overwritten.

Example:

$ text = "File Name"

WriteFileFast (addr (text $), area #, 0, & bytes)