|
-
Jan 4th, 2005, 03:57 PM
#1
Thread Starter
Banned
VB: DX: drawing text...
whao i was just adding text. some B's to my tiles to tell its blocked. guess what... it slowed down like hell
has anyone noticed this to?
this is my code:
VB Code:
Do Until L > LayerMax
If Not Layers.cLayer(L).Value = vbUnchecked Then
Let xTemp = xZ
Let yTemp = yZ
Let X = 0
Do Until X > Map.Width
Let xDest = xTemp
Let yDest = yTemp
Let Y = 0
Do Until Y > Map.Height
If Map.TileX(L, X, Y) > -1 And Map.TileY(L, X, Y) > -1 Then
Let rTile.Left = Map.TileX(L, X, Y) * TileWidth
Let rTile.Top = Map.TileY(L, X, Y) * TileHeight
Let rTile.Right = rTile.Left + TileWidth
Let rTile.Bottom = rTile.Top + TileHeight
Call BufferSurface.BltFast(xDest, yDest, GroundTiles, rTile, DDBLTFAST_DONOTWAIT Or DDBLTFAST_SRCCOLORKEY)
End If
If Map.Blocked(L, X, Y) Then
[COLOR=Blue][B]Call BufferSurface.DrawText(xDest + TileHalfWidth, yDest, "B", False)[/B][/COLOR]
End If
Let xDest = xDest - TileHalfWidth
Let yDest = yDest + TileHalfHeight
Let Y = Y + 1
Loop
Let xTemp = xTemp + TileHalfWidth
Let yTemp = yTemp + TileHalfHeight
Let X = X + 1
Loop
End If
Let L = L + 1
Loop
-
Jan 6th, 2005, 05:30 AM
#2
Thread Starter
Banned
Re: VB: DX: drawing text...
is there a faster way to draw text?
-
Jan 6th, 2005, 05:31 AM
#3
Thread Starter
Banned
Re: VB: DX: drawing text...
nvm i will do it difrent.. when you hover a tile i will make it so it shows in the sbar if its blocked or not...
-
Jan 6th, 2005, 08:37 AM
#4
Ex-Super Mod'rater
Re: VB: DX: drawing text...
Incase it still helps a faster way would be to have an image with the alphabet on and then you change the SrcRect to choose dirrefent letters. This would be quicker I guess cos its missing out the font stuff and basically just rendering a graphic .
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Jan 6th, 2005, 08:45 AM
#5
Thread Starter
Banned
Re: VB: DX: drawing text...
i dint set the font... is that why its so slow?
-
Jan 6th, 2005, 09:09 AM
#6
Ex-Super Mod'rater
Re: VB: DX: drawing text...
If you don't set the font then it would just use the default one but I would think its the process of it needing to use the font to work out what the text looks like first and then it still has to draw the thing after that. So if you've already made a FontList Image then your just drawing simple graphics and it dkips out that stage and instead it just takes a little of your time at design time to generate the FontList Image .
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Jan 6th, 2005, 09:27 AM
#7
Thread Starter
Banned
Re: VB: DX: drawing text...
cant i just set the font..... or something...
-
Jan 6th, 2005, 09:30 AM
#8
Ex-Super Mod'rater
Re: VB: DX: drawing text...
Yea you can set the font but I can't see that speeding things up .
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Jan 6th, 2005, 09:30 AM
#9
Thread Starter
Banned
Re: VB: DX: drawing text...
arf.....!!!!! well i just made a block image that will do it....
-
Jan 6th, 2005, 09:34 AM
#10
Thread Starter
Banned
Re: VB: DX: drawing text...
Set ddSurface = DD.CreateSurfaceFromResource(File, Name, DDSD)
automation error... File is "Map Editor.Res" name is "102"
why ???
-
Jan 6th, 2005, 09:53 AM
#11
Ex-Super Mod'rater
Re: VB: DX: drawing text...
For the -2147467259 error the SDK says:
HRESULT: 0x80004005 (2147500037)
Name: E_FAIL
Description: An undetermined error occurred
Severity code: Failed
Facility Code: FACILITY_NULL (0)
Error Code: 0x4005 (16389)
Personally I've never used CreateSurfaceFromResource() I only ever use CreateSurfaceFromFile().
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Jan 6th, 2005, 10:11 AM
#12
Thread Starter
Banned
Re: VB: DX: drawing text...
i tried it like here
http://216.5.163.53/DirectX4VB/Tutor...D_ResFiles.asp
on this line it says
Let DDSD.lWidth = LoadResPicture(Name, vbPicTypeBitmap).Width
it cant find the resource???????????!!!!!!!11
its there!!!
-
Jan 6th, 2005, 06:09 PM
#13
Re: VB: DX: drawing text...
Try CreateSurfaceFromFile.
Sorry I haven't posted in here for awhile. Girl problems.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|