Home   Help Search Login Register  

Author Topic: Sliders  (Read 1503 times)

0 Members and 1 Guest are viewing this topic.

Offline UH60MG

  • Members
  • *
Sliders
« on: 21 Feb 2008, 17:00:29 »
How do I get a slider to appear in ArmA?

Here is the code in the description I tried...

Quote
#define FontM "Zeppelin32"
#define FontHTML "Zeppelin32"

#define ST_LEFT       0
#define ST_RIGHT      1
#define ST_CENTER     2
#define ST_FRAME      64

#define CT_STATIC     0
#define CT_BUTTON     1
#define CT_SLIDER     3

#define CT_COMBO      4
#define CT_LISTBOX    5

#define SL_DIR            0x400
#define SL_VERT           0
#define SL_HORZ           0x400



class RscText
{
        type = CT_STATIC;
        idc = -1;
        style = ST_LEFT;
        colorBackground[] = {0, 0, 0, 0};
        colorText[] = {0, 0, 0, 1};
        font = FontM;
        sizeEx = 0.025;
};

class RscSliderH
{
       type = CT_SLIDER;
       style = ST_LEFT;
       color[] = {0.2, 0.2, 0.2, 1};
       idc = -1;
       sizeEx = 0.025;
};


class DlgStart
{
  idd = -1;
  movingEnable = true;

  objects[] = { };
  controls[] = { MY_SLIDER};


  class MY_SLIDER : RscSliderH
  {
     idc = 204;
     x = 0.25;
     y = 0.3;
     w = 0.5;
     h = 0.04;
  };

};

This doesn't show a slider. What am I doing wrong?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Sliders
« Reply #1 on: 21 Feb 2008, 17:10:40 »
Code: [Select]
  style = ST_LEFT; ----> style = 1024;

Offline UH60MG

  • Members
  • *
Re: Sliders
« Reply #2 on: 21 Feb 2008, 17:37:39 »
Thanks.

And how do I read the current position of the slider?


I tried this in  a script but it doesn't work (displays '0' no matter what)

titleText [format ["%1", sliderPosition 204], "PLAIN", 2]
« Last Edit: 21 Feb 2008, 19:02:05 by UH60MG »

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Sliders
« Reply #3 on: 21 Feb 2008, 18:28:37 »
Just informing, moved this here since this is where the dialog stuff should even if it might not feel advanced for some. :)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Sliders
« Reply #4 on: 21 Mar 2008, 11:30:14 »
First you need to give the slider its range and "speeds":

_myslidercontrol sliderSetRange [0, 359];
_myslidercontrol sliderSetSpeed [1, 10];

For example, then you will be able to read the position.