View Single Post
 
Old 07-23-2012, 03:06 PM
hDC_0 hDC_0 is offline
Contributor

* Expert *
 
Join Date: Feb 2004
Posts: 559
Default VB_Alien returns..after over a month's absense..

Hey you're back!
Quote:
Originally Posted by VB_Alien
i was thinking about how tile transitions work.
Is this a continuance of your Custom Control Image Property thread and/or your Copying tiles from sheet thread?

I didn't post in your custom control thread because I didn't want to discourage you,
but in this post there is code, for Public Sub New(), to turn on doublebuffering:
Code:
Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
Me.SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
Me.UpdateStyles()
Note: This also works on a panel control, which can act as a container control for using "layered on" picturebox graphics.

However, you can also just
load a picture straight from a file into a memory-based Bitmap object
(to basically have a backbuffer for the graphic) using:
Code:
' Load the picture into a Bitmap.
Dim bm As New Bitmap(file_name)
' Display the results.
picImage.Image = bm
picImage.SizeMode = PictureBoxSizeMode.AutoSize
The more "polite" way of doing this is here.

Code for loading to an Image object (using that as a backbuffer),
and then DrawImageUnscaled painting to a panel control is also shown on this jo0ls post.

jo0ls also posted some nice Surface class code on this social.msdn thread.

Personally I think flipping backbuffered graphics directly onto the form,
(with DoubleBuffered property set to true),
is just as valid as using controls so long as a Multiple buffering pipeline
is set up correctly offscreen.

Do you ever have a chance to play around with the
VB_Alien_MapMaker-rev_1_dot_1.zip
that surfR2911 posted as the last post in you tiles sheet thread?

There are a whole bunch of ways to do tile transitions:
1.) A "flip map" hop, with or without a tile map scrolling (1, 2)
2.) A 2D "shoots and ladders" type transition
3.) A teleporter pad (with round go-thru portal or flying pad, DungeonSeige-style)
4.) An alpha-blended transition stairway (like Diablo-style)

Speaking of which, if you look for the links to the old VB6 demo that
rpgnewbie did for alphablended transitioning of Diablo-style rpg graphics
most of the links are broken (because they used the old style thread urls).

Additionally rpgnewbie had trouble getting the whole thing up in one zip
because of the upload limitations (and frequent time-outs) of the forum back then,
so maybe I it's time to try and do a re-posting to restore the attachment to its whole condition.

It's a very humble demo, but it still has gotten over 1000 "views" for parts A & B combined,
meaning close to 600 people at least tried it out to date.

In terms of an alphablending demo, using rpg graphics, that is designed to show a transitioning:
"when you go inside a building or behind a pillar the game "fades out" the blocking wall/roof/pillar."
it's pretty much the best demo available,
even though it uses isometric tiling
(and of course for your purposes would need some VB.Net alphablending code
similar to what is going on now in posts #19, #22, & #25 of the Viewer thread).
Attached Images
File Type: jpg screenshot_alphafade_with_diablostyle_graphics.JPG (123.1 KB, 23 views)
Attached Files
File Type: zip DiabloStyle_AlphaFade_demo_partsA-n-B.zip (688.9 KB, 26 views)

Last edited by hDC_0; 07-23-2012 at 04:53 PM.
Reply With Quote