| 13 | | "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed\n" |
| 14 | | "do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n" |
| 15 | | "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris\n" |
| 16 | | "nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in..." |
| | 13 | "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed\n" |
| | 14 | "do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n" |
| | 15 | "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris\n" |
| | 16 | "nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in..." |
| 28 | | label->setFont("fonts/arial.ttf"); |
| 29 | | label->setFontSize(size); |
| 30 | | label->setFontColor(1.0f, 1.0f, 1.0f, 1.0f); |
| 31 | | label->setLabel(l); |
| | 28 | label->setFont("fonts/arial.ttf"); |
| | 29 | label->setFontSize(size); |
| | 30 | label->setFontColor(1.0f, 1.0f, 1.0f, 1.0f); |
| | 31 | label->setLabel(l); |
| 45 | | osgWidget::WindowManager* wm = new osgWidget::WindowManager( |
| 46 | | &viewer, |
| 47 | | 1280.0f, |
| 48 | | 1024.0f, |
| 49 | | MASK_2D, |
| 50 | | osgWidget::WindowManager::WM_PICK_DEBUG | |
| 51 | | osgWidget::WindowManager::WM_NO_INVERT_Y |
| 52 | | ); |
| 53 | | |
| 54 | | osgWidget::Box* box = new osgWidget::Box("HBOX", osgWidget::Box::HORIZONTAL); |
| 55 | | osgWidget::Box* vbox = new osgWidget::Box("vbox", osgWidget::Box::VERTICAL); |
| 56 | | osgWidget::Label* label1 = createLabel(LABEL1); |
| 57 | | osgWidget::Label* label2 = createLabel(LABEL2); |
| | 45 | osgWidget::WindowManager* wm = new osgWidget::WindowManager( |
| | 46 | &viewer, |
| | 47 | 1280.0f, |
| | 48 | 1024.0f, |
| | 49 | MASK_2D, |
| | 50 | osgWidget::WindowManager::WM_PICK_DEBUG | |
| | 51 | osgWidget::WindowManager::WM_NO_INVERT_Y |
| | 52 | ); |
| | 53 | |
| | 54 | osgWidget::Box* box = new osgWidget::Box("HBOX", osgWidget::Box::HORIZONTAL); |
| | 55 | osgWidget::Box* vbox = new osgWidget::Box("vbox", osgWidget::Box::VERTICAL); |
| | 56 | osgWidget::Label* label1 = createLabel(LABEL1); |
| | 57 | osgWidget::Label* label2 = createLabel(LABEL2); |
| 66 | | label1->setColor(1.0f, 0.5f, 0.0f, 0.0f); |
| 67 | | label2->setColor(1.0f, 0.5f, 0.0f, 0.0f); |
| | 66 | label1->setColor(1.0f, 0.5f, 0.0f, 0.0f); |
| | 67 | label2->setColor(1.0f, 0.5f, 0.0f, 0.0f); |
| 75 | | // Setup the labels for the vertical box. |
| 76 | | osgWidget::Label* label3 = createLabel("Label 3", 80); |
| 77 | | osgWidget::Label* label4 = createLabel("Label 4", 60); |
| 78 | | osgWidget::Label* label5 = createLabel("ABCDEFGHIJK", 93); |
| | 75 | // Setup the labels for the vertical box. |
| | 76 | osgWidget::Label* label3 = createLabel("Label 3", 80); |
| | 77 | osgWidget::Label* label4 = createLabel("Label 4", 60); |
| | 78 | osgWidget::Label* label5 = createLabel("ABCDEFGHIJK", 93); |
| 84 | | label3->setColor(0.0f, 0.0f, 0.5f, 0.5f); |
| 85 | | label4->setColor(0.0f, 0.0f, 0.5f, 0.5f); |
| 86 | | label5->setColor(0.0f, 0.0f, 0.5f, 0.5f); |
| 87 | | |
| 88 | | label5->setAlignHorizontal(osgWidget::Widget::HA_LEFT); |
| 89 | | label5->setAlignVertical(osgWidget::Widget::VA_BOTTOM); |
| | 84 | label3->setColor(0.0f, 0.0f, 0.5f, 0.5f); |
| | 85 | label4->setColor(0.0f, 0.0f, 0.5f, 0.5f); |
| | 86 | label5->setColor(0.0f, 0.0f, 0.5f, 0.5f); |
| | 87 | |
| | 88 | label5->setAlignHorizontal(osgWidget::Widget::HA_LEFT); |
| | 89 | label5->setAlignVertical(osgWidget::Widget::VA_BOTTOM); |
| 105 | | // vbox->setVisibilityMode(osgWidget::Window::VM_ENTIRE); |
| 106 | | // vbox->setVisibleArea(50, 50, 500, 200); |
| 107 | | // vbox->setAnchorVertical(osgWidget::Window::VA_TOP); |
| 108 | | // vbox->setAnchorHorizontal(osgWidget::Window::HA_RIGHT); |
| | 105 | // vbox->setVisibilityMode(osgWidget::Window::VM_ENTIRE); |
| | 106 | // vbox->setVisibleArea(50, 50, 500, 200); |
| | 107 | // vbox->setAnchorVertical(osgWidget::Window::VA_TOP); |
| | 108 | // vbox->setAnchorHorizontal(osgWidget::Window::HA_RIGHT); |
| 110 | | // Test our label-in-window copy construction... |
| 111 | | osgWidget::Box* clonedBox = box->cloneAs("HBOX-new"); |
| 112 | | |
| 113 | | clonedBox->getBackground()->setColor(0.0f, 1.0f, 0.0f, 0.5f); |
| | 110 | // Test our label-in-window copy construction... |
| | 111 | osgWidget::Box* clonedBox = box->cloneAs("HBOX-new"); |
| | 112 | |
| | 113 | clonedBox->getBackground()->setColor(0.0f, 1.0f, 0.0f, 0.5f); |