Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

How to Blt something to picScreen!


Growlith1223
 Share

Recommended Posts

hi there! This is my 5th tutorial i think and this is a tutorial on how to Blt something to the game screen or known as, picScreen!

first. make your declarations or whatever it's called.
I will be making an HUD :3

so i would put.
```
' Render the HUD
Public DDS_HUD As DirectDrawSuface7
Public DDSD_HUD As DDSURFACEDESC2

```These are the DirectDraw surfaces. They're what represent the graphic on your screen. - Encyclopedia Dramatica
Next, make a file check in the InitSurfaces
```
If FileExist(App.Path & "\data files\graphics\gui\main\hud.bmp", True) Then Call InitDDSurf("gui\main\HUD", DDSD_HUD, DDS_HUD)

```This will check if the file exist, and if it does, then it loads that file.

then, make a new Public Sub

here's mine.
```
Public Sub BltHUD()
Dim x As Long, y As Long, rec As DxVBLib.RECT

'Rect/Rec is a simple way to say Rectangle. The RECT is the area to grab from your bmp
'In this case it is the whole thing while in sprites/tiles it is only portions.
With rec
    .top = 0
    .Left = 0
    .Right = 189
    .Bottom = 51
End With
                                                                          'V This here basically tells it to cut out ur color in pixel 1x1.
Call Engine_BltFast(Camera.Right - rec.Right, Camera.top, DDS_HUD, rec, DDBLTFAST_SRCCOLORKEY)

End Sub
```
And then, in the Render_Graphics
```
' Clarifies that you are wanting to use it
bltHUD

```put it anywhere depending if you want it above everything that is displayed on the screen.

and test it and enjoy your new HUD or whatever you made with this!!!

Sincerely, Growlith1223

NOTE: it should look like the screenie below but without the green line xD
Link to comment
Share on other sites

What is the blt bit? That would probably clear things up to me what this actually does.

Right now to me it looks like this is how you actually get things to sit on top of the game screen and not behind it even when you click "bring to front" on everything lol.
Link to comment
Share on other sites

@kahnival:

> What is the blt bit? That would probably clear things up to me what this actually does.
>
> Right now to me it looks like this is how you actually get things to sit on top of the game screen and not behind it even when you click "bring to front" on everything lol.

The Blt bit is to clarify the properties of it and BltHUD in the Render_Graphics displays that.@Zopto:

> wery niceee!

thx :D

@Lumiere:

> Thank you for this  Grow ^^

No Problem ^^
Link to comment
Share on other sites

```
Public DDS_HUD As DirectDrawSuface7
Public DDSD_HUD As DDSURFACEDESC2

```
These are the DirectDraw surfaces. They're what represent the graphic on your screen.

If you don't know what you're doing, and lack to explain every unfamiliar element, then this is a waste of peoples time when they're looking to learn.

You could've easily researched yourself, because when you don't know what you're doing, you're not helping anyone.

The comments in the source were a nice gesture though, at least you did that much compared to others.

tl;dr

If you don't know, don't say anything.
Link to comment
Share on other sites

Whenever I resize the picscreen so the game itself fills more space everything is behind it…And when I select bring them to front they are still behind...I thought that this code might be what was needed to actually bring them to the front, sorry if I'm wrong I'm still learning ^.^
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...