added the ability to query the scene graph nodes in world space

This commit is contained in:
Dylan Wilson
2016-02-27 21:41:30 +10:00
parent ec117b8b54
commit 5f8c54ec35
10 changed files with 463 additions and 42 deletions
@@ -47,3 +47,19 @@
/processorParam:TextureFormat=Color
/build:car-wheel.png
#begin montserrat-32.fnt
/importer:BitmapFontImporter
/processor:BitmapFontProcessor
/build:montserrat-32.fnt
#begin montserrat-32_0.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:TextureFormat=Color
/build:montserrat-32_0.png
@@ -0,0 +1,341 @@
<?xml version="1.0"?>
<font>
<info face="Montserrat" size="32" bold="1" italic="0" charset="" unicode="1" stretchH="100" smooth="1" aa="1" padding="0,0,0,0" spacing="1,1" outline="0"/>
<common lineHeight="32" base="27" scaleW="256" scaleH="256" pages="1" packed="0" alphaChnl="1" redChnl="0" greenChnl="0" blueChnl="0"/>
<pages>
<page id="0" file="montserrat-32_0.png" />
</pages>
<chars count="95">
<char id="32" x="88" y="44" width="3" height="1" xoffset="-1" yoffset="31" xadvance="6" page="0" chnl="15" />
<char id="33" x="250" y="21" width="5" height="19" xoffset="2" yoffset="8" xadvance="7" page="0" chnl="15" />
<char id="34" x="72" y="103" width="8" height="8" xoffset="2" yoffset="8" xadvance="12" page="0" chnl="15" />
<char id="35" x="0" y="49" width="19" height="19" xoffset="0" yoffset="8" xadvance="20" page="0" chnl="15" />
<char id="36" x="0" y="0" width="16" height="27" xoffset="0" yoffset="4" xadvance="17" page="0" chnl="15" />
<char id="37" x="118" y="24" width="25" height="19" xoffset="1" yoffset="8" xadvance="28" page="0" chnl="15" />
<char id="38" x="172" y="0" width="17" height="20" xoffset="1" yoffset="8" xadvance="18" page="0" chnl="15" />
<char id="39" x="251" y="61" width="4" height="8" xoffset="2" yoffset="8" xadvance="7" page="0" chnl="15" />
<char id="40" x="72" y="0" width="8" height="24" xoffset="2" yoffset="7" xadvance="9" page="0" chnl="15" />
<char id="41" x="62" y="0" width="9" height="24" xoffset="1" yoffset="7" xadvance="10" page="0" chnl="15" />
<char id="42" x="61" y="104" width="10" height="9" xoffset="0" yoffset="8" xadvance="10" page="0" chnl="15" />
<char id="43" x="13" y="105" width="13" height="13" xoffset="0" yoffset="12" xadvance="14" page="0" chnl="15" />
<char id="44" x="81" y="103" width="6" height="7" xoffset="0" yoffset="23" xadvance="7" page="0" chnl="15" />
<char id="45" x="130" y="100" width="7" height="3" xoffset="1" yoffset="17" xadvance="10" page="0" chnl="15" />
<char id="46" x="107" y="100" width="5" height="5" xoffset="1" yoffset="22" xadvance="7" page="0" chnl="15" />
<char id="47" x="29" y="0" width="13" height="25" xoffset="-1" yoffset="5" xadvance="10" page="0" chnl="15" />
<char id="48" x="170" y="42" width="17" height="19" xoffset="1" yoffset="8" xadvance="19" page="0" chnl="15" />
<char id="49" x="203" y="61" width="9" height="19" xoffset="0" yoffset="8" xadvance="11" page="0" chnl="15" />
<char id="50" x="130" y="64" width="15" height="19" xoffset="1" yoffset="8" xadvance="16" page="0" chnl="15" />
<char id="51" x="236" y="61" width="14" height="18" xoffset="0" yoffset="9" xadvance="15" page="0" chnl="15" />
<char id="52" x="17" y="69" width="16" height="19" xoffset="1" yoffset="8" xadvance="17" page="0" chnl="15" />
<char id="53" x="114" y="64" width="15" height="19" xoffset="0" yoffset="8" xadvance="16" page="0" chnl="15" />
<char id="54" x="146" y="64" width="15" height="19" xoffset="1" yoffset="8" xadvance="17" page="0" chnl="15" />
<char id="55" x="98" y="64" width="15" height="19" xoffset="1" yoffset="8" xadvance="16" page="0" chnl="15" />
<char id="56" x="82" y="66" width="15" height="19" xoffset="1" yoffset="8" xadvance="17" page="0" chnl="15" />
<char id="57" x="66" y="67" width="15" height="19" xoffset="1" yoffset="8" xadvance="17" page="0" chnl="15" />
<char id="58" x="27" y="105" width="5" height="12" xoffset="1" yoffset="15" xadvance="6" page="0" chnl="15" />
<char id="59" x="233" y="80" width="6" height="15" xoffset="0" yoffset="15" xadvance="7" page="0" chnl="15" />
<char id="60" x="240" y="80" width="12" height="14" xoffset="1" yoffset="11" xadvance="14" page="0" chnl="15" />
<char id="61" x="48" y="104" width="12" height="9" xoffset="1" yoffset="14" xadvance="14" page="0" chnl="15" />
<char id="62" x="0" y="108" width="12" height="14" xoffset="1" yoffset="11" xadvance="14" page="0" chnl="15" />
<char id="63" x="190" y="61" width="12" height="19" xoffset="0" yoffset="8" xadvance="13" page="0" chnl="15" />
<char id="64" x="141" y="0" width="24" height="22" xoffset="0" yoffset="9" xadvance="25" page="0" chnl="15" />
<char id="65" x="144" y="23" width="21" height="19" xoffset="0" yoffset="8" xadvance="21" page="0" chnl="15" />
<char id="66" x="219" y="61" width="16" height="18" xoffset="2" yoffset="9" xadvance="19" page="0" chnl="15" />
<char id="67" x="78" y="46" width="18" height="19" xoffset="1" yoffset="8" xadvance="19" page="0" chnl="15" />
<char id="68" x="59" y="47" width="18" height="19" xoffset="2" yoffset="8" xadvance="21" page="0" chnl="15" />
<char id="69" x="34" y="68" width="15" height="19" xoffset="2" yoffset="8" xadvance="18" page="0" chnl="15" />
<char id="70" x="241" y="41" width="14" height="19" xoffset="2" yoffset="8" xadvance="16" page="0" chnl="15" />
<char id="71" x="116" y="44" width="17" height="19" xoffset="1" yoffset="8" xadvance="20" page="0" chnl="15" />
<char id="72" x="134" y="44" width="17" height="19" xoffset="2" yoffset="8" xadvance="21" page="0" chnl="15" />
<char id="73" x="213" y="61" width="5" height="19" xoffset="2" yoffset="8" xadvance="9" page="0" chnl="15" />
<char id="74" x="176" y="62" width="13" height="19" xoffset="0" yoffset="8" xadvance="14" page="0" chnl="15" />
<char id="75" x="40" y="47" width="18" height="19" xoffset="2" yoffset="8" xadvance="20" page="0" chnl="15" />
<char id="76" x="162" y="63" width="13" height="19" xoffset="2" yoffset="8" xadvance="15" page="0" chnl="15" />
<char id="77" x="229" y="21" width="20" height="19" xoffset="2" yoffset="8" xadvance="25" page="0" chnl="15" />
<char id="78" x="206" y="41" width="17" height="19" xoffset="2" yoffset="8" xadvance="21" page="0" chnl="15" />
<char id="79" x="208" y="21" width="20" height="19" xoffset="1" yoffset="8" xadvance="22" page="0" chnl="15" />
<char id="80" x="50" y="67" width="15" height="19" xoffset="2" yoffset="8" xadvance="18" page="0" chnl="15" />
<char id="81" x="81" y="0" width="21" height="23" xoffset="1" yoffset="8" xadvance="22" page="0" chnl="15" />
<char id="82" x="188" y="41" width="17" height="19" xoffset="2" yoffset="8" xadvance="20" page="0" chnl="15" />
<char id="83" x="224" y="41" width="16" height="19" xoffset="0" yoffset="8" xadvance="17" page="0" chnl="15" />
<char id="84" x="0" y="69" width="16" height="19" xoffset="1" yoffset="8" xadvance="16" page="0" chnl="15" />
<char id="85" x="97" y="44" width="18" height="19" xoffset="1" yoffset="8" xadvance="20" page="0" chnl="15" />
<char id="86" x="187" y="21" width="20" height="19" xoffset="0" yoffset="8" xadvance="20" page="0" chnl="15" />
<char id="87" x="88" y="24" width="29" height="19" xoffset="0" yoffset="8" xadvance="29" page="0" chnl="15" />
<char id="88" x="166" y="22" width="20" height="19" xoffset="0" yoffset="8" xadvance="20" page="0" chnl="15" />
<char id="89" x="20" y="48" width="19" height="19" xoffset="0" yoffset="8" xadvance="18" page="0" chnl="15" />
<char id="90" x="152" y="43" width="17" height="19" xoffset="1" yoffset="8" xadvance="18" page="0" chnl="15" />
<char id="91" x="123" y="0" width="8" height="23" xoffset="2" yoffset="7" xadvance="10" page="0" chnl="15" />
<char id="92" x="43" y="0" width="13" height="25" xoffset="1" yoffset="5" xadvance="12" page="0" chnl="15" />
<char id="93" x="132" y="0" width="8" height="23" xoffset="2" yoffset="7" xadvance="12" page="0" chnl="15" />
<char id="94" x="33" y="105" width="14" height="11" xoffset="1" yoffset="12" xadvance="16" page="0" chnl="15" />
<char id="95" x="113" y="100" width="16" height="3" xoffset="0" yoffset="29" xadvance="16" page="0" chnl="15" />
<char id="96" x="99" y="100" width="7" height="5" xoffset="1" yoffset="7" xadvance="9" page="0" chnl="15" />
<char id="97" x="164" y="83" width="14" height="15" xoffset="1" yoffset="12" xadvance="16" page="0" chnl="15" />
<char id="98" x="0" y="28" width="16" height="20" xoffset="2" yoffset="7" xadvance="18" page="0" chnl="15" />
<char id="99" x="179" y="82" width="14" height="15" xoffset="0" yoffset="12" xadvance="15" page="0" chnl="15" />
<char id="100" x="208" y="0" width="17" height="20" xoffset="0" yoffset="7" xadvance="19" page="0" chnl="15" />
<char id="101" x="116" y="84" width="15" height="15" xoffset="0" yoffset="12" xadvance="16" page="0" chnl="15" />
<char id="102" x="243" y="0" width="12" height="20" xoffset="0" yoffset="7" xadvance="10" page="0" chnl="15" />
<char id="103" x="34" y="26" width="15" height="20" xoffset="1" yoffset="12" xadvance="17" page="0" chnl="15" />
<char id="104" x="66" y="25" width="15" height="20" xoffset="2" yoffset="7" xadvance="18" page="0" chnl="15" />
<char id="105" x="166" y="0" width="5" height="21" xoffset="2" yoffset="6" xadvance="8" page="0" chnl="15" />
<char id="106" x="17" y="0" width="11" height="26" xoffset="-3" yoffset="6" xadvance="9" page="0" chnl="15" />
<char id="107" x="50" y="26" width="15" height="20" xoffset="2" yoffset="7" xadvance="17" page="0" chnl="15" />
<char id="108" x="82" y="24" width="5" height="20" xoffset="2" yoffset="7" xadvance="9" page="0" chnl="15" />
<char id="109" x="39" y="88" width="24" height="15" xoffset="2" yoffset="12" xadvance="28" page="0" chnl="15" />
<char id="110" x="132" y="84" width="15" height="15" xoffset="2" yoffset="12" xadvance="18" page="0" chnl="15" />
<char id="111" x="64" y="87" width="17" height="15" xoffset="0" yoffset="12" xadvance="17" page="0" chnl="15" />
<char id="112" x="226" y="0" width="16" height="20" xoffset="2" yoffset="12" xadvance="18" page="0" chnl="15" />
<char id="113" x="190" y="0" width="17" height="20" xoffset="0" yoffset="12" xadvance="19" page="0" chnl="15" />
<char id="114" x="222" y="80" width="10" height="15" xoffset="2" yoffset="12" xadvance="12" page="0" chnl="15" />
<char id="115" x="208" y="81" width="13" height="15" xoffset="0" yoffset="12" xadvance="14" page="0" chnl="15" />
<char id="116" x="0" y="89" width="11" height="18" xoffset="0" yoffset="9" xadvance="12" page="0" chnl="15" />
<char id="117" x="148" y="84" width="15" height="15" xoffset="1" yoffset="12" xadvance="18" page="0" chnl="15" />
<char id="118" x="82" y="86" width="16" height="15" xoffset="0" yoffset="12" xadvance="15" page="0" chnl="15" />
<char id="119" x="12" y="89" width="26" height="15" xoffset="0" yoffset="12" xadvance="25" page="0" chnl="15" />
<char id="120" x="99" y="84" width="16" height="15" xoffset="0" yoffset="12" xadvance="16" page="0" chnl="15" />
<char id="121" x="17" y="27" width="16" height="20" xoffset="0" yoffset="12" xadvance="16" page="0" chnl="15" />
<char id="122" x="194" y="81" width="13" height="15" xoffset="1" yoffset="12" xadvance="15" page="0" chnl="15" />
<char id="123" x="113" y="0" width="9" height="23" xoffset="1" yoffset="7" xadvance="10" page="0" chnl="15" />
<char id="124" x="57" y="0" width="4" height="25" xoffset="2" yoffset="5" xadvance="8" page="0" chnl="15" />
<char id="125" x="103" y="0" width="9" height="23" xoffset="1" yoffset="7" xadvance="11" page="0" chnl="15" />
<char id="126" x="88" y="102" width="10" height="5" xoffset="2" yoffset="16" xadvance="14" page="0" chnl="15" />
</chars>
<kernings count="234">
<kerning first="39" second="46" amount="-1" />
<kerning first="122" second="89" amount="-1" />
<kerning first="122" second="87" amount="-1" />
<kerning first="122" second="86" amount="-1" />
<kerning first="121" second="65" amount="-1" />
<kerning first="120" second="113" amount="-1" />
<kerning first="120" second="111" amount="-1" />
<kerning first="120" second="103" amount="-1" />
<kerning first="120" second="101" amount="-1" />
<kerning first="120" second="100" amount="-1" />
<kerning first="120" second="99" amount="-1" />
<kerning first="120" second="97" amount="-1" />
<kerning first="120" second="89" amount="-1" />
<kerning first="120" second="87" amount="-1" />
<kerning first="120" second="86" amount="-1" />
<kerning first="120" second="85" amount="-1" />
<kerning first="119" second="65" amount="-1" />
<kerning first="119" second="46" amount="-1" />
<kerning first="118" second="65" amount="-1" />
<kerning first="118" second="46" amount="-1" />
<kerning first="116" second="89" amount="-1" />
<kerning first="116" second="87" amount="-1" />
<kerning first="116" second="86" amount="-1" />
<kerning first="115" second="89" amount="-1" />
<kerning first="45" second="74" amount="-1" />
<kerning first="47" second="57" amount="-1" />
<kerning first="115" second="87" amount="-1" />
<kerning first="115" second="86" amount="-1" />
<kerning first="114" second="121" amount="1" />
<kerning first="114" second="119" amount="1" />
<kerning first="114" second="118" amount="1" />
<kerning first="114" second="89" amount="-1" />
<kerning first="114" second="87" amount="-1" />
<kerning first="114" second="86" amount="-1" />
<kerning first="112" second="120" amount="-1" />
<kerning first="112" second="89" amount="-2" />
<kerning first="112" second="87" amount="-2" />
<kerning first="112" second="86" amount="-2" />
<kerning first="112" second="84" amount="-2" />
<kerning first="112" second="74" amount="-1" />
<kerning first="112" second="65" amount="-1" />
<kerning first="111" second="120" amount="-1" />
<kerning first="111" second="89" amount="-2" />
<kerning first="111" second="87" amount="-2" />
<kerning first="111" second="86" amount="-2" />
<kerning first="111" second="84" amount="-2" />
<kerning first="111" second="74" amount="-1" />
<kerning first="55" second="46" amount="-1" />
<kerning first="65" second="67" amount="-1" />
<kerning first="65" second="71" amount="-1" />
<kerning first="65" second="79" amount="-1" />
<kerning first="65" second="81" amount="-1" />
<kerning first="111" second="65" amount="-1" />
<kerning first="65" second="84" amount="-2" />
<kerning first="65" second="85" amount="-1" />
<kerning first="65" second="86" amount="-1" />
<kerning first="65" second="87" amount="-1" />
<kerning first="65" second="89" amount="-1" />
<kerning first="65" second="92" amount="-1" />
<kerning first="65" second="99" amount="-1" />
<kerning first="65" second="100" amount="-1" />
<kerning first="65" second="101" amount="-1" />
<kerning first="65" second="103" amount="-1" />
<kerning first="65" second="111" amount="-1" />
<kerning first="65" second="113" amount="-1" />
<kerning first="65" second="116" amount="-1" />
<kerning first="65" second="117" amount="-1" />
<kerning first="65" second="118" amount="-1" />
<kerning first="65" second="119" amount="-1" />
<kerning first="65" second="121" amount="-1" />
<kerning first="110" second="89" amount="-1" />
<kerning first="110" second="87" amount="-1" />
<kerning first="110" second="86" amount="-1" />
<kerning first="109" second="89" amount="-1" />
<kerning first="109" second="87" amount="-1" />
<kerning first="109" second="86" amount="-1" />
<kerning first="107" second="113" amount="-1" />
<kerning first="107" second="111" amount="-1" />
<kerning first="107" second="103" amount="-1" />
<kerning first="107" second="101" amount="-1" />
<kerning first="107" second="100" amount="-1" />
<kerning first="107" second="99" amount="-1" />
<kerning first="107" second="97" amount="-1" />
<kerning first="107" second="89" amount="-1" />
<kerning first="107" second="87" amount="-1" />
<kerning first="107" second="86" amount="-1" />
<kerning first="107" second="85" amount="-1" />
<kerning first="104" second="89" amount="-1" />
<kerning first="104" second="87" amount="-1" />
<kerning first="104" second="86" amount="-1" />
<kerning first="102" second="121" amount="1" />
<kerning first="102" second="119" amount="1" />
<kerning first="102" second="118" amount="1" />
<kerning first="102" second="108" amount="1" />
<kerning first="102" second="107" amount="1" />
<kerning first="102" second="104" amount="1" />
<kerning first="102" second="98" amount="1" />
<kerning first="102" second="97" amount="-1" />
<kerning first="102" second="89" amount="2" />
<kerning first="102" second="87" amount="2" />
<kerning first="102" second="86" amount="2" />
<kerning first="102" second="84" amount="2" />
<kerning first="102" second="82" amount="1" />
<kerning first="102" second="81" amount="1" />
<kerning first="102" second="80" amount="1" />
<kerning first="102" second="79" amount="1" />
<kerning first="102" second="78" amount="1" />
<kerning first="102" second="77" amount="1" />
<kerning first="102" second="76" amount="1" />
<kerning first="102" second="75" amount="1" />
<kerning first="102" second="73" amount="1" />
<kerning first="102" second="72" amount="1" />
<kerning first="102" second="71" amount="1" />
<kerning first="102" second="70" amount="1" />
<kerning first="102" second="69" amount="1" />
<kerning first="102" second="68" amount="1" />
<kerning first="102" second="67" amount="1" />
<kerning first="102" second="66" amount="1" />
<kerning first="101" second="125" amount="-1" />
<kerning first="101" second="120" amount="-1" />
<kerning first="101" second="89" amount="-2" />
<kerning first="101" second="87" amount="-2" />
<kerning first="101" second="86" amount="-2" />
<kerning first="101" second="84" amount="-2" />
<kerning first="101" second="74" amount="-1" />
<kerning first="101" second="65" amount="-1" />
<kerning first="99" second="89" amount="-1" />
<kerning first="99" second="87" amount="-1" />
<kerning first="99" second="86" amount="-1" />
<kerning first="98" second="120" amount="-1" />
<kerning first="98" second="89" amount="-2" />
<kerning first="98" second="87" amount="-2" />
<kerning first="98" second="86" amount="-2" />
<kerning first="98" second="84" amount="-2" />
<kerning first="98" second="74" amount="-1" />
<kerning first="98" second="65" amount="-1" />
<kerning first="97" second="89" amount="-1" />
<kerning first="97" second="87" amount="-1" />
<kerning first="97" second="86" amount="-1" />
<kerning first="89" second="122" amount="-1" />
<kerning first="89" second="120" amount="-1" />
<kerning first="89" second="117" amount="-1" />
<kerning first="89" second="116" amount="-1" />
<kerning first="89" second="115" amount="-1" />
<kerning first="89" second="114" amount="-1" />
<kerning first="68" second="46" amount="-1" />
<kerning first="68" second="65" amount="-1" />
<kerning first="89" second="113" amount="-2" />
<kerning first="89" second="111" amount="-2" />
<kerning first="68" second="74" amount="-1" />
<kerning first="89" second="110" amount="-1" />
<kerning first="89" second="109" amount="-1" />
<kerning first="68" second="84" amount="-1" />
<kerning first="89" second="103" amount="-2" />
<kerning first="89" second="101" amount="-2" />
<kerning first="89" second="100" amount="-2" />
<kerning first="89" second="99" amount="-2" />
<kerning first="89" second="97" amount="-1" />
<kerning first="89" second="65" amount="-1" />
<kerning first="89" second="38" amount="-1" />
<kerning first="87" second="122" amount="-1" />
<kerning first="87" second="120" amount="-1" />
<kerning first="87" second="117" amount="-1" />
<kerning first="87" second="116" amount="-1" />
<kerning first="87" second="115" amount="-1" />
<kerning first="87" second="114" amount="-1" />
<kerning first="87" second="113" amount="-2" />
<kerning first="87" second="111" amount="-2" />
<kerning first="87" second="110" amount="-1" />
<kerning first="87" second="109" amount="-1" />
<kerning first="87" second="103" amount="-2" />
<kerning first="87" second="101" amount="-2" />
<kerning first="87" second="100" amount="-2" />
<kerning first="87" second="99" amount="-2" />
<kerning first="87" second="97" amount="-1" />
<kerning first="87" second="65" amount="-1" />
<kerning first="86" second="122" amount="-1" />
<kerning first="86" second="120" amount="-1" />
<kerning first="86" second="117" amount="-1" />
<kerning first="70" second="46" amount="-1" />
<kerning first="70" second="65" amount="-1" />
<kerning first="86" second="116" amount="-1" />
<kerning first="86" second="115" amount="-1" />
<kerning first="86" second="114" amount="-1" />
<kerning first="86" second="113" amount="-2" />
<kerning first="86" second="111" amount="-2" />
<kerning first="86" second="110" amount="-1" />
<kerning first="86" second="109" amount="-1" />
<kerning first="86" second="103" amount="-2" />
<kerning first="86" second="101" amount="-2" />
<kerning first="74" second="65" amount="-1" />
<kerning first="86" second="100" amount="-2" />
<kerning first="74" second="120" amount="-1" />
<kerning first="86" second="99" amount="-2" />
<kerning first="86" second="97" amount="-1" />
<kerning first="86" second="65" amount="-1" />
<kerning first="86" second="46" amount="-1" />
<kerning first="86" second="38" amount="-1" />
<kerning first="85" second="120" amount="-1" />
<kerning first="85" second="65" amount="-1" />
<kerning first="75" second="67" amount="-1" />
<kerning first="75" second="71" amount="-1" />
<kerning first="75" second="79" amount="-1" />
<kerning first="75" second="81" amount="-1" />
<kerning first="85" second="46" amount="-1" />
<kerning first="84" second="113" amount="-2" />
<kerning first="84" second="111" amount="-2" />
<kerning first="84" second="108" amount="-1" />
<kerning first="84" second="107" amount="-1" />
<kerning first="84" second="104" amount="-1" />
<kerning first="84" second="103" amount="-2" />
<kerning first="84" second="101" amount="-2" />
<kerning first="84" second="100" amount="-2" />
<kerning first="76" second="92" amount="-1" />
<kerning first="84" second="99" amount="-2" />
<kerning first="84" second="98" amount="-1" />
<kerning first="84" second="81" amount="-1" />
<kerning first="84" second="79" amount="-1" />
<kerning first="84" second="71" amount="-1" />
<kerning first="84" second="67" amount="-1" />
<kerning first="84" second="65" amount="-2" />
<kerning first="79" second="46" amount="-1" />
<kerning first="79" second="65" amount="-1" />
<kerning first="84" second="46" amount="-1" />
<kerning first="84" second="38" amount="-1" />
<kerning first="79" second="74" amount="-1" />
<kerning first="81" second="84" amount="-1" />
<kerning first="81" second="74" amount="-1" />
<kerning first="79" second="84" amount="-1" />
<kerning first="81" second="65" amount="-1" />
<kerning first="81" second="46" amount="-1" />
<kerning first="80" second="74" amount="-1" />
<kerning first="80" second="65" amount="-1" />
<kerning first="80" second="46" amount="-1" />
</kernings>
</font>
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

@@ -58,12 +58,14 @@
<Content Include="Content\car-hull.png" />
<Content Include="Content\car-wheel.png" />
<Content Include="Content\logo-square-512.png" />
<Content Include="Content\montserrat-32_0.png" />
<Content Include="Icon.ico" />
</ItemGroup>
<ItemGroup>
<MonoGameContentReference Include="Content\Content.mgcb" />
</ItemGroup>
<ItemGroup>
<None Include="Content\montserrat-32.fnt" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
+25 -7
View File
@@ -2,6 +2,7 @@
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using MonoGame.Extended;
using MonoGame.Extended.BitmapFonts;
using MonoGame.Extended.SceneGraphs;
using MonoGame.Extended.Shapes;
using MonoGame.Extended.Sprites;
@@ -13,12 +14,14 @@ namespace Demo.SceneGraphs
{
private readonly GraphicsDeviceManager _graphicsDeviceManager;
private readonly bool _isFullScreen;
private BitmapFont _bitmapFont;
private SpriteBatch _spriteBatch;
private Camera2D _camera;
private SceneGraph _sceneGraph;
private SceneNode _leftWheelNode;
private SceneNode _rightWheelNode;
private SceneNode _carNode;
private SceneNode _hoveredNode;
public Game1()
{
@@ -48,6 +51,8 @@ namespace Demo.SceneGraphs
{
_spriteBatch = new SpriteBatch(GraphicsDevice);
_bitmapFont = Content.Load<BitmapFont>("montserrat-32");
var viewportAdapter = new BoxingViewportAdapter(Window, GraphicsDevice, 800, 480);
_camera = new Camera2D(viewportAdapter) {Zoom = 2.0f};
_sceneGraph = new SceneGraph();
@@ -57,16 +62,14 @@ namespace Demo.SceneGraphs
var carWheelTexture = Content.Load<Texture2D>("car-wheel");
var carWheelSprite = new Sprite(carWheelTexture);
_carNode = _sceneGraph.RootNode.CreateChildSceneNode(viewportAdapter.Center.ToVector2());
_carNode = _sceneGraph.RootNode.CreateChildSceneNode("car-hull", viewportAdapter.Center.ToVector2());
_carNode.Attach(carHullSprite);
_leftWheelNode = _carNode.CreateChildSceneNode(new Vector2(-29, 17));
_leftWheelNode = _carNode.CreateChildSceneNode("left-wheel", new Vector2(-29, 17));
_leftWheelNode.Attach(carWheelSprite);
_rightWheelNode = _carNode.CreateChildSceneNode(new Vector2(40, 17));
_rightWheelNode = _carNode.CreateChildSceneNode("right-wheel", new Vector2(40, 17));
_rightWheelNode.Attach(carWheelSprite);
}
protected override void UnloadContent()
@@ -79,6 +82,7 @@ namespace Demo.SceneGraphs
{
var deltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds;
var keyboardState = Keyboard.GetState();
var mouseState = Mouse.GetState();
if (keyboardState.IsKeyDown(Keys.Escape))
Exit();
@@ -108,6 +112,9 @@ namespace Demo.SceneGraphs
_carNode.Position = new Vector2(minX, _carNode.Position.Y);
}
var worldPosition = _camera.ScreenToWorld(mouseState.X, mouseState.Y);
_hoveredNode = _sceneGraph.GetSceneNodeAt(worldPosition);
base.Update(gameTime);
}
@@ -116,13 +123,24 @@ namespace Demo.SceneGraphs
GraphicsDevice.Clear(Color.CornflowerBlue);
_spriteBatch.Begin(samplerState: SamplerState.PointClamp, transformMatrix: _camera.GetViewMatrix());
_spriteBatch.Draw(_sceneGraph);
_spriteBatch.FillRectangle(0, 266, 800, 240, Color.DarkOliveGreen);
_spriteBatch.FillRectangle(200, 0, 5, 480, Color.DarkOliveGreen);
_spriteBatch.FillRectangle(595, 0, 5, 480, Color.DarkOliveGreen);
if (_hoveredNode != null)
{
var boundingRectangle = _hoveredNode.GetBoundingRectangle();
_spriteBatch.DrawRectangle(boundingRectangle, Color.Black);
}
_spriteBatch.End();
_spriteBatch.Begin();
if (_hoveredNode != null)
_spriteBatch.DrawString(_bitmapFont, _hoveredNode.Name, new Vector2(14, 2), Color.White);
_spriteBatch.End();
base.Draw(gameTime);
@@ -1,4 +1,7 @@
using MonoGame.Extended.Shapes;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MonoGame.Extended.Shapes;
using MonoGame.Extended.TextureAtlases;
namespace MonoGame.Extended.SceneGraphs
{
@@ -6,4 +9,16 @@ namespace MonoGame.Extended.SceneGraphs
{
RectangleF GetBoundingRectangle();
}
public interface ISpriteBatchDrawable
{
bool IsVisible { get; }
TextureRegion2D TextureRegion { get; }
Vector2 Position { get; }
float Rotation { get; }
Vector2 Scale { get; }
Color Color { get; }
Vector2 Origin { get; }
SpriteEffects Effect { get; }
}
}
@@ -1,7 +1,6 @@
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MonoGame.Extended.Sprites;
namespace MonoGame.Extended.SceneGraphs
{
@@ -16,38 +15,29 @@ namespace MonoGame.Extended.SceneGraphs
public void Draw(SpriteBatch spriteBatch)
{
if (RootNode != null)
DrawNode(spriteBatch, RootNode, Matrix.Identity);
RootNode?.Draw(spriteBatch);
}
private void DrawNode(SpriteBatch spriteBatch, SceneNode sceneNode, Matrix parentTransform)
public SceneNode GetSceneNodeAt(float x, float y)
{
var localTransform = sceneNode.GetLocalTransform();
var globalTransform = Matrix.Multiply(localTransform, parentTransform);
var node = RootNode;
Vector2 position, scale;
float rotation;
globalTransform.Decompose(out position, out rotation, out scale);
foreach (var sprite in sceneNode.Entities.OfType<Sprite>())
DrawSprite(spriteBatch, sprite, position, rotation, scale);
foreach (var child in sceneNode.Children)
DrawNode(spriteBatch, child, globalTransform);
}
private void DrawSprite(SpriteBatch spriteBatch, Sprite sprite, Vector2 offsetPosition, float offsetRotation, Vector2 offsetScale)
{
if (sprite.IsVisible)
while (node != null && node.GetBoundingRectangle().Contains(x, y))
{
var texture = sprite.TextureRegion.Texture;
var sourceRectangle = sprite.TextureRegion.Bounds;
var position = offsetPosition + sprite.Position;
var rotation = offsetRotation + sprite.Rotation;
var scale = offsetScale * sprite.Scale;
var childNode = node.Children.FirstOrDefault(c => c.GetBoundingRectangle().Contains(x, y));
spriteBatch.Draw(texture, position, sourceRectangle, sprite.Color, rotation, sprite.Origin, scale, sprite.Effect, 0);
if(childNode != null)
node = childNode;
else
return node;
}
return null;
}
public SceneNode GetSceneNodeAt(Vector2 position)
{
return GetSceneNodeAt(position.X, position.Y);
}
}
}
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MonoGame.Extended.Shapes;
namespace MonoGame.Extended.SceneGraphs
@@ -34,19 +35,28 @@ namespace MonoGame.Extended.SceneGraphs
public RectangleF GetBoundingRectangle()
{
if(!_entities.Any())
return new RectangleF(Position.X, Position.Y, 0, 0);
Vector2 position, scale;
float rotation;
GetWorldTransform().Decompose(out position, out rotation, out scale);
var rectangles = _entities
.Select(e => e.GetBoundingRectangle())
.Select(e =>
{
var r = e.GetBoundingRectangle();
r.Offset(position);
return r;
})
.Concat(_children.Select(i => i.GetBoundingRectangle()))
.ToArray();
var x0 = rectangles.Min(r => r.Left);
var y0 = rectangles.Min(r => r.Top);
var x1 = rectangles.Max(r => r.Right);
var y1 = rectangles.Max(r => r.Bottom);
return new RectangleF(Position.X + x0, Position.Y + y0, x1 - x0, y1 - y0);
}
return new RectangleF(x0, y0, x1 - x0, y1 - y0);
}
internal static SceneNode CreateRootNode()
{
return new SceneNode(null, null, Vector2.Zero, 0, Vector2.One);
@@ -113,6 +123,11 @@ namespace MonoGame.Extended.SceneGraphs
_entities.Add(entity);
}
public Matrix GetWorldTransform()
{
return Parent == null ? Matrix.Identity : Matrix.Multiply(GetLocalTransform(), Parent.GetWorldTransform());
}
public Matrix GetLocalTransform()
{
var rotationMatrix = Matrix.CreateRotationZ(Rotation);
@@ -126,5 +141,30 @@ namespace MonoGame.Extended.SceneGraphs
{
return $"name: {Name}, position: {Position}, rotation: {Rotation}, scale: {Scale}";
}
public void Draw(SpriteBatch spriteBatch)
{
Vector2 offsetPosition, offsetScale;
float offsetRotation;
var worldTransform = GetWorldTransform();
worldTransform.Decompose(out offsetPosition, out offsetRotation, out offsetScale);
foreach (var drawable in Entities.OfType<ISpriteBatchDrawable>())
{
if (drawable.IsVisible)
{
var texture = drawable.TextureRegion.Texture;
var sourceRectangle = drawable.TextureRegion.Bounds;
var position = offsetPosition + drawable.Position;
var rotation = offsetRotation + drawable.Rotation;
var scale = offsetScale * drawable.Scale;
spriteBatch.Draw(texture, position, sourceRectangle, drawable.Color, rotation, drawable.Origin, scale, drawable.Effect, 0);
}
}
foreach (var child in Children)
child.Draw(spriteBatch);
}
}
}
+2 -2
View File
@@ -8,11 +8,11 @@ using MonoGame.Extended.TextureAtlases;
namespace MonoGame.Extended.Sprites
{
public class Sprite : IMovable, IRotatable, IScalable, ISceneEntity
public class Sprite : IMovable, IRotatable, IScalable, ISceneEntity, ISpriteBatchDrawable
{
public Sprite(TextureRegion2D textureRegion)
{
if (textureRegion == null) throw new ArgumentNullException("textureRegion");
if (textureRegion == null) throw new ArgumentNullException(nameof(textureRegion));
_textureRegion = textureRegion;
@@ -1,5 +1,4 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MonoGame.Extended.Animations;