Jump to content
Sign in to follow this  
Guest ridgell

String manipulation (rotation)

Recommended Posts

Guest ridgell

I was wondering if I could illicit a little tutorial about manipulating strings, in particular rotation.I have searched the net, and the forum here (thought I am not as adept a searcher in the new format as I was with the old one) and cant find the answers.I have looked at the big formatted strings in text based HUDS (special fonts) but what I would like is a more rudimentary explanation/understanding. I can rotate ploylines & bitmaps as good as any. I do not understand how the length of a string is measured or fixed and how to assign the axis of rotation of a string within an assigned field. For example rotating a single line string with 2 or 3 off-center numbers in a circle in an arbitrary field...say 400x400.

Share this post


Link to post
Share on other sites
I was wondering if I could illicit a little tutorial about manipulating strings, in particular rotation.I have searched the net, and the forum here (thought I am not as adept a searcher in the new format as I was with the old one) and cant find the answers.I have looked at the big formatted strings in text based HUDS (special fonts) but what I would like is a more rudimentary explanation/understanding. I can rotate ploylines & bitmaps as good as any. I do not understand how the length of a string is measured or fixed and how to assign the axis of rotation of a string within an assigned field. For example rotating a single line string with 2 or 3 off-center numbers in a circle in an arbitrary field...say 400x400.
Hi Ridgell Here is some code from my HSI its got rotate and 2 shifts in it maybe there is something in it to help you. <Position X="0" Y="0"/> <Text X="52" Y="18" Length="5" BackgroundColor="0x101010" Font="Arial" FontWeight="400" Color="#00FF00" Adjust="Left" Bright="Yes" VerticalAdjust="Center" Multiline="No"> <String>%((A:NAV2 RADIAL, degrees) d360)%R-%!03d!%</String> <Axis X="26" Y="9"/> </Text> <Rotate> <Value>(A:PLANE HEADING DEGREES GYRO, radians) (A:GPS Ground Magnetic Track, radians) - </Value> </Rotate> <Shift> <Value>(A:NAV2 RADIAL, radians) pi + (A:GPS MAGVAR, radians) - (A:GPS Ground Magnetic Track, radians) - /-/ cos (L:Nav2dist,nmiles) * /-/ (L:HSI RANGE, number) 50 min 12 max 80 / /</Value> <Scale Y="1.5"> </Scale> </Shift><Shift> <Value>(A:NAV2 RADIAL, radians) pi + (A:GPS MAGVAR, radians) - (A:GPS Ground Magnetic Track, radians) - /-/ sin (L:Nav2dist,nmiles) * /-/ (L:HSI RANGE, number) 50 min 12 max 80 / /</Value> <Scale X="1.5"> </Scale> </Shift> </Element> This rotates nav2 radial number around the HSI while keeping the text horizontal and pivoting in the text center.

Paul EGLD

Share this post


Link to post
Share on other sites

I'm curious why so few people use the "Code" feature of this new forum software when posting code or XML script snippets? In the past we didn't have such a neat feature, but now that we do few bother to use it :( The neatest part of wrapping code/scripts with the "code" tags is that all formatting is preserved, and it makes cutting/pasting from the forum much easier...For example, which of these is the easiest to read? :( <Macro Name="ProcedureScrollDown"> (@g:currentGroup) @kPROCPageGroup == if{ (@g:blinkingField) 1 == (@g:blinkingFieldEnabled1) 0 == and if{ 2 (>@g:blinkingField) } (@g:blinkingField) 2 == (@g:blinkingFieldEnabled2) 0 == and if{ 3 (>@g:blinkingField) } (@g:blinkingField) 3 == (@g:blinkingFieldEnabled3) 0 == and if{ 2 (>@g:blinkingField) } (@g:blinkingField) 2 == (@g:blinkingFieldEnabled2) 0 == and if{ 1 (>@g:blinkingField) } } </Macro>

	<Macro Name="ProcedureScrollDown">		(@g:currentGroup) @kPROCPageGroup == if{			(@g:blinkingField) 1 == (@g:blinkingFieldEnabled1) 0 == and if{ 2 (>@g:blinkingField) }			(@g:blinkingField) 2 == (@g:blinkingFieldEnabled2) 0 == and if{ 3 (>@g:blinkingField) }			(@g:blinkingField) 3 == (@g:blinkingFieldEnabled3) 0 == and if{ 2 (>@g:blinkingField) }			(@g:blinkingField) 2 == (@g:blinkingFieldEnabled2) 0 == and if{ 1 (>@g:blinkingField) }		}	</Macro>


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Here is Paul's XML script formatted and wrapped in the forum's "code" tags:

<Element>	 <Position X="0" Y="0"/> 		<Text X="52" Y="18" Length="5" BackgroundColor="0x101010" Font="Arial" FontWeight="400" Color="#00FF00"			Adjust="Left" Bright="Yes" VerticalAdjust="Center" Multiline="No">   			<String>%((A:NAV2 RADIAL, degrees) d360)%R-%!03d!%</String>			<Axis X="26" Y="9"/>		</Text>		<Rotate>			<Value>				(A:PLANE HEADING DEGREES GYRO, radians) 				(A:GPS Ground Magnetic Track, radians) - 			</Value>		</Rotate>		<Shift> 			<Value>				(A:NAV2 RADIAL, radians) pi + 				(A:GPS MAGVAR, radians) - 				(A:GPS Ground Magnetic Track, radians) - /-/ cos 				(L:Nav2dist,nmiles) * /-/ 				(L:HSI RANGE, number) 50 min 12 max 80 / /			</Value>			<Scale Y="1.5"> </Scale> 		</Shift>		<Shift> 			<Value>				(A:NAV2 RADIAL, radians) pi + 				(A:GPS MAGVAR, radians) - 				(A:GPS Ground Magnetic Track, radians) - /-/ sin 				(L:Nav2dist,nmiles) * /-/ 				(L:HSI RANGE, number) 50 min 12 max 80 / /			</Value>			<Scale X="1.5"> </Scale> 		</Shift>  </Element>


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...