Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

String manipulation (rotation)

Featured Replies

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.

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

  • Moderator

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
  • Moderator

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

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.