Jump to content
Sign in to follow this  
Guest bartels

MAKE_ICON for moving Knob

Recommended Posts

Guest taku

Asking again about altimeter with barometer knob.Now I am trying to get the function of moving knob with changing barometic setting. I know that I should use "MAKE_ICON" element, however I am confusing at Field "SWITCH_TYPE".Maybe I should take "ICON_SWITICH_TYPE_SET_CUR_USING_ RANGE" ,but there is no sample for that type. So question is,1)Is "ICON_SWITICH_TYPE_SET_CUR_USING_ RANGE" adequate for the purpose?2)How to use "offset" and "scale" for the type? I would be so happy if there are any sample code. I am quite new to making gauges, and also relatively new and have only poor knowledgement of C language. Thanks in advance.

Share this post


Link to post
Share on other sites
Guest bartels

First the question, why MAKE_ICON?MAKE_ICONS are for displaying different bitmaps at the same place. You can of course simulate somthing like a stop-motion moving effect with it (like the XML gauges in the Baron, quite ugly in my opinion). So why not try MAKE_NEEDLE, MAKE_MOVING, MAKE_SLIDER....?Secondly, how to use MAKE_ICON with ICON_SWITICH_TYPE_SET_CUR_USING_RANGE? A MAKE_ICON consists of several bitmaps indexed 0,1,... NUM_ICONS-1. With ICON_SWITCH_TYPE_SET_CUR_ICON you have to return the index in the callback if used. With ICON_SWITICH_TYPE_SET_CUR_USING_RANGE the indexes are calculated from the token variable or the callback by subtracting OFFSET (at least I think so, I used 0) and then dividing by SCALE. The result is rounded to be used as an index to your bitmap list.Arne Bartels

Share this post


Link to post
Share on other sites
Guest taku

>So why not try MAKE_NEEDLE, MAKE_MOVING, MAKE_SLIDER....?I see. That's quite true.The reason I tried to use MAKE_ICON,I am studying to make copy of 767PIC gauges.I got bitmaps from 767PIC's altimeter gauge by using GAU2BMP.There are 8 knob bitmaps which are each rotated 45 degrees.So, I thought this is using MAKE_ICON to display moving knobs.Anyway, I'll try with MAKE_NEEDLE to get same function.Thanks so much for your help!Taku

Share this post


Link to post
Share on other sites
Guest

>>So why not try MAKE_NEEDLE, MAKE_MOVING, MAKE_SLIDER....?>>I see. That's quite true.>>The reason I tried to use MAKE_ICON,>I am studying to make copy of 767PIC gauges.>I got bitmaps from 767PIC's altimeter gauge by using GAU2BMP.>There are 8 knob bitmaps which are each rotated 45 degrees.>So, I thought this is using MAKE_ICON to display moving>knobs.Using a "needle" instead of an set of icons makes good sense, if only for reasons of file size economy, not to mention the smoother appearance of a rotating knob... :)BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://catholic-hymns.com/frbill/FS2002/images/fartslogo.jpg

Share this post


Link to post
Share on other sites
Guest bartels

One potential problems with MAKE_NEEDLEs is that they might look distorted if they are near a border of the panel background bitmap. If you are far from the border it doesn't make any effect. Otherwise use MAKE_SPRITE instead.Arne Bartels

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...