Mirage Source
http://miragesource.net/forums/

[Feature] Dynamic Tile Width
http://miragesource.net/forums/viewtopic.php?f=183&t=5489
Page 1 of 49

Author:  Labmonkey [ Mon Apr 13, 2009 9:11 pm ]
Post subject:  [Feature] Dynamic Tile Width

Ok, so this tutorial will make it so that you can putin any size tilesheet with any width and the game will figure out its width and change TILESHEET_WIDTH accordingly. The first thing we have to do for this is make a horizontal scroll bar for our map editor, otherwise we can't use tilesheets bigger then our map editor.

Go to frmMirage,and add a new horizantle scroll bar under where the map editor tiles are. You may want to move some things down to fit this in.

Name the scroll bar hscrlPicture

now in frmMirage add this sub
Code:
Private Sub hscrlPicture_Change()
    Call MapEditorTileHScroll
End Sub


We might as well also add under this line
Code:
    scrlPicture.Max = (picBackSelect.Height \ PIC_Y) - (picBack.Height \ PIC_Y)


and under this line
Code:
    Call InitTileSurf(scrlTileSet)

Code:
    Call CalcTilePositions


These bits should make more sense later.

Now go to modGameEditors and add this sub
Code:
Public Sub MapEditorTileHScroll()
    With frmMirage
        .picBackSelect.Left = (.hscrlPicture.Value * PIC_X) * -1
        .picScreen.Refresh
    End With
End Sub


we put the picscreen.refresh in because when picbackselect goes behind picscreen it makes an ugly grey box, and its better to just refresh the whole screen. You can remove it if you want.

Now lets do the actual dynamic width part

find
Code:
Public Const TILESHEET_WIDTH As Integer = 7 ' * PIC_X pixels

comment it out, or delete it

now in modGlobals add this at the bottom
Code:
'Tilesheet width
Public TILESHEET_WIDTH As Integer



in modDirectDraw7 in the InitTileSurf sub under this code
Code:
Call InitDDSurf("tiles" & TileSet, DDS_Tile)

put
Code:
    TILESHEET_WIDTH = modDirectDraw7.DDS_Tile.SurfDescription.lWidth \ PIC_X



I hope this works for you!

Author:  jaheoo [ Fri Jul 17, 2009 7:25 pm ]
Post subject:  Re: [Feature] Dynamic Tile Width

Run time error 11: Devision by zero

It highlights in the modgamelogic module

also in the Public Sub CalcTilePositions()

"MapTilePosition(X, Y).Ground.Top = (Map.Tile(X, Y).Ground \ TILESHEET_WIDTH) * PIC_Y"

Author:  Egon [ Fri Jul 17, 2009 7:45 pm ]
Post subject:  Re: [Feature] Dynamic Tile Width

jaheoo wrote:
Run time error 11: Devision by zero

It highlights in the modgamelogic module

also in the Public Sub CalcTilePositions()

"MapTilePosition(X, Y).Ground.Top = (Map.Tile(X, Y).Ground \ TILESHEET_WIDTH) * PIC_Y"

Make your TILESHEET_WIDTH not equal 0 pixels wide then... Or make sure it's named as "tiles"

Author:  jaheoo [ Fri Jul 17, 2009 9:59 pm ]
Post subject:  Re: [Feature] Dynamic Tile Width

How do I make sure the TILESHEET_WIDTH is not equal to 0 pixels wide? Through the code or through the properties?

Also I have named the tilesheet Tiles1 because the latest version of mirage has already built in Tiles1 and Tiles 2 you can use.

Author:  genusis [ Tue Jul 21, 2009 12:53 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

This may be stupid but why Dynamic tile width why not Dynamic maps which would be much better.

Author:  Rian [ Tue Jul 21, 2009 6:15 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

genusis wrote:
This may be stupid but why Dynamic tile width why not Dynamic maps which would be much better.


Two completely different things.

Author:  genusis [ Tue Jul 21, 2009 12:23 pm ]
Post subject:  Re: [Feature] Dynamic Tile Width

im just saying since Dynamic tiles seem kind of pointless XD.

Author:  Beres [ Tue Jul 21, 2009 10:28 pm ]
Post subject:  Re: [Feature] Dynamic Tile Width

How is it pointless? Its purpose is that you don't have to edit your tile sheets to fit the size Mirage uses. I don't find it pointless.

Author:  wanai [ Wed Dec 01, 2021 8:52 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.rumagnetotelluricfield.rumailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.ruсайтsemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoningtechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.ruhttp://temperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru

Author:  wanai [ Tue Jan 04, 2022 7:13 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

Econ

Author:  wanai [ Tue Jan 04, 2022 7:14 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

92.6

Author:  wanai [ Tue Jan 04, 2022 7:16 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

Bett

Author:  wanai [ Tue Jan 04, 2022 7:17 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

Bett

Author:  wanai [ Tue Jan 04, 2022 7:18 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

Greg

Author:  wanai [ Tue Jan 04, 2022 7:19 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

Jewe

Author:  wanai [ Tue Jan 04, 2022 7:20 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

West

Author:  wanai [ Tue Jan 04, 2022 7:21 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

Dant

Author:  wanai [ Tue Jan 04, 2022 7:22 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

XVII

Author:  wanai [ Tue Jan 04, 2022 7:23 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

Mich

Author:  wanai [ Tue Jan 04, 2022 7:24 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

What

Author:  wanai [ Tue Jan 04, 2022 7:26 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

Samb

Author:  wanai [ Tue Jan 04, 2022 7:27 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

Appl

Author:  wanai [ Tue Jan 04, 2022 7:28 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

Colu

Author:  wanai [ Tue Jan 04, 2022 7:29 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

John

Author:  wanai [ Tue Jan 04, 2022 7:30 am ]
Post subject:  Re: [Feature] Dynamic Tile Width

Else

Page 1 of 49 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/