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.

ADI in XML, I need explenation

Featured Replies

Hi there,i'm currently building my first ADI, at the moment I don't wanna have it precise or any indications on it, I just want that the card is in the frame... but right now it looks like thishttp://img168.imageshack.us/img168/4024/problemvt7.jpgthe code is as follows(A:Attitude indicator pitch degrees,degrees) /-/(A:Attitude indicator bank degrees,radians)Now the first picture calles Background.bmp is the Frame of the ADI, Mask.bmp is black, Ladder is what you also see on the screenshot...can anyone try to help me and explain it to me, as I didn't yet really understood the tutorial I read... maybe someone can explain me the structure step by stepthese are the three bitmaps I havehttp://img265.imageshack.us/img265/8103/workud5.jpgRegardsJohann

As Ed said you are using the background image as a mask, which is why the ladder.bmp is showing. The structure is this.Background.bmpMask.bmpLadder.bmpCode Taken from a PFD I did a while ago(A:Circuit general panel on,bool) Your bitmap would be Background.bmp - Frame of the ADI // Your bitmap would be mask.bmp//Your bitmap would be Ladder.bmp(A:Attitude indicator pitch degrees, degrees) /-/(A:Attitude indicator bank degrees, radians)make sure the mask image is 1,1,1 for the bit you want to see and 0,0,0 for the bits that you do not want to see.Hope this helps

Hi,Personally I don't use a mask for ADI's but rather a set of bitmaps in this order:- Ladder- Attitude background with Alpha- Attitude background with tag that removes upper and lower excedents from ladder bitmap -to avoid the problem you seem to have in your example.Something like:Tom

  • Moderator

The most obvious problem is that you have the transparent and mask areas inverted! What you have as 0,0,0 should be 1,1,1 and vice-versa... ;)http://img265.imageshack.us/img265/8103/workud5.jpg

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

>The most obvious problem is that you have the transparent and>mask areas inverted! What you have as 0,0,0 should be 1,1,1>and vice-versa... ;)>>>Bill, even that it's true the mask area is inverted, it is not a problem in the way he did the code because the ladder is being drawn over the mask bitmap, which means this last one plays no game at all here.The problem, as we can see in his composed picture, is that the ladder bmp overpasses both top and bottom of the gauge's cage. This is easy to fix using a tag, as I explained above - or resizing the ladder bmp (wouldn't be my choice though)-Tom

ok, i started the whole thing again from scratch and got it to work now..this is how it looks in FS Panelstudioadinm1.jpgand this is how it looks in FSadiflusiiu3.jpgIf i'm not mistaken you move the top left corner of a bitmap with the axis command... i tried some different combinations, but didn't get the ADI Card Centeredhere's the code(A:Attitude indicator pitch degrees, degrees) /-/(A:Attitude indicator bank degrees, radians)

"If i'm not mistaken you move the top left corner of a bitmap with the axis command..."Actually what you 'define' with the tag is the displacement (offset) of X and Y coordinates as to set the center of rotation for the bitmap - using together with a tag.In case of , the coordinate's reference is given by tag, so you need to keep this in mind when working with combined with . In your example, I believe should be your reference point, adjusting only Y scale to positive and negative values as neeeded.It is very common to use a tag instead of for , as it is expected Y to vary up/down proportionaly.Tom

yeah, I used the scale command in my first code, well, now i implented it again and I found the error... actualy a pretty stupid one: I was simply using the wrong .bmp file for the ADI Card, which had a different seize...thanks for your help anyway

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.