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

Panoramas


vqoley
 Share

Recommended Posts

Programming this could give you some troubles, but here's a skeleton guide:

* Add the variable Background As Byte into the MapRec types both server/client-side. This sets our client variable to map.background; the server, map(index).background.
* Edit the map properties editor to include that Map.Rec variable
* Add Map.Background to the buffer in SendMapData and HandleMapData, in both subs on both server and client. The location of the variable in the buffer in handle/send for a set must run parallel, or your reading and writing won't line up. Use WriteByte where WriteLong is being used, and ReadByte where ReadLong is being used.
* Mimic how, for example, CheckTilesets works, to make sub CheckBackgrounds,
* Then add a call for CheckBackgrounds near the call for the other graphics checks.
* Add TEX_BackGrounds() As DX8TextureRec near the texture declarations in order for CheckBackgrounds to work.
* Add DrawBackground() before tiles are rendered
* Add a sub for DrawBackground that uses the Map.Background variable (or a default when map.background = 0). You can make this parallax by using a much wider background and changing the SX of rendertexture's call to Camera.Left. If RenderTexture has an SX + SWidth that goes beyond the right boundary of your image, nothing will render. The same applies for SY + SHeight for the bottom. You could also use Camera.Top to scroll up and down.

To help you get started:

```
Public Sub DrawBackground(ByVal Index As Long)

' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler

If Map.Background > 0 Then
RenderTexture Tex_Background(Map.Background), 0, 0, 0, 0, ScreenX, ScreenY, ScreenX, ScreenY
Else
'do nothing to include no background

'or, set a default
'RenderTexture Tex_Background(1), 0, 0, 0, 0, ScreenX, ScreenY, ScreenX, ScreenY
End If

'Parallax would instead above use something like:
'RenderTexture Tex_Background(Map.Background), 0, 0, CameraX, 0, ScreenX, ScreenY, ScreenX, ScreenY

' Error handler
Exit Sub
errorhandler:
HandleError "DrawBlood", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

```
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...