Click to See Complete Forum and Search --> : Scrolling images?
git
Sep 19th, 2000, 02:37 AM
I'm really new to BitBlt, so please go easy. ;-)
Is it possible (using BitBlt) to transfer an image onto an object/Picture, and then make it so it's scrollable? Is it also possible to find how many twips (I think that's the term) the point the person has clicked is in from the edge of the object/Picture?
Thanks.
-Git
Fox
Sep 19th, 2000, 05:45 AM
Twips suck, use Pixel ;)
Well, sure it's possible. Check out some BitBlt demos (there are demos on my site) to understand how it works. The idea is to draw just a part of a big map (or many tiles) onto a picture. Then you just have to change the 'source' coordinates to make it scrolling everywhere.
And if you still have questions feel free to ask :)
git
Sep 19th, 2000, 05:49 AM
Cool, thank you. =)
-Git
git
Sep 19th, 2000, 07:27 AM
I checked your example, but I need something probably a little simpler. It just has to be a Picture that can scroll, but it needs to be as fast loading as possible (aka no flickering or slow loads) - I wouldn't mind if it used BitBlt or something else, just as long as it's the fastest way.
Thanks. =)
-Git
Fox
Sep 19th, 2000, 11:28 AM
Can you explain a bit more? If you need the picture ie. for a game you should use tiles, but if you ust have a big picture you want to scroll it's probably faster to move a picturebox ;)
git
Sep 19th, 2000, 08:54 PM
Here's the rundown... =)
I want to have a large grid, up to maybe 200 squares x 200 squares. I've already got BitBlt working - it properly reads grid data then puts the proper image on the grid, that's perfect.
What I want to do is have the ability to scroll the grid/map. I'm making a turn-based squad game, so I don't want the view to be centred on a particular soldier - the game itself is best comparable to a birds-eye view version of XCom: UFO Defense, sort of like Email XCom but a single player game.
I've already tried making a huge PictureBox. I think I made it like a width of 99999 and height of 99999. I was moving it around the screen with the scrollbars, it was visible beyond the map area, on the rest of the form, but I figured I could probably hide it later. Anyway ... VB accepted 99999 as legal values but BitBlt didn't - when I ran it, it died ... =/ Even on a smaller scale (about 10000 IIRC) it doesn't like it.
I was considering just having small maps, say on a grid size of 15 x 20 (with no scrolling), but I've since decided to have huge tactical maps so missions are more in depth and not so quick.
Thanks!
-Git
Warmaster199
Sep 19th, 2000, 09:13 PM
I know you are using BitBlt, but, as you may (or may not) know, DirectDraw will be alot faster in loading your bitmaps. DirectDraw will also Blt your bitmaps at a wayyyyy faster rate that BitBlt would ever hope to. This is because DirectX's DirectDraw interfaces directly (hence "Direct"X) to you system's hardware. Hardware is faster than software operations to let you know. BitBlt has to go through windows before it can draw images on the screen and therefore, it is not direct.
Conclusion: I recommend DirectDraw for your game because of it's high speed, Direct Hardware interface.
Fox
Sep 20th, 2000, 12:05 AM
Indeed.
Well, about your game, what you need is a tile engine. You draw the tiles from your map (grid) which are on the screen and add x and y coordinates ie. of a camera so you can scroll... the demos on my website shouldn't be too complicated ;) (There's also a DDraw example).
Hope this helps
git
Sep 20th, 2000, 12:11 AM
I've found a way how to do it quite easily.
Basically I have 3 picture boxes. One loads individual tiles/sprites, the other has one of each of these images (one very very very long row), and the other is the map.
When the map is moved it just gets the map tile types from an array and re-BitBlts it from the long row of images.
It's extremely fast for BitBlting the grid, even on my P200. I'm not sure of the exact FPS, but I know it's definately over 20 (probably a LOT more).
Thanks. =)
-Git
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.