From Jeremy Moles, Updated file references to reflect new data in OpenSceneGraph-Data

This commit is contained in:
Robert Osfield 2008-07-15 22:30:51 +00:00
parent a8cb408213
commit a20e5791d9
8 changed files with 27 additions and 27 deletions

View File

@ -13,7 +13,7 @@ class ABCWidget: public osgWidget::Label {
public:
ABCWidget(const std::string& label):
osgWidget::Label("", label) {
setFont("fonts/Calibri1.ttf");
setFont("fonts/Vera.ttf");
setFontSize(20);
setCanFill(true);
setShadow(0.08f);
@ -25,7 +25,7 @@ class Button: public osgWidget::Label {
public:
Button(const std::string& label):
osgWidget::Label("", label) {
setFont("fonts/Calibri1.ttf");
setFont("fonts/Vera.ttf");
setFontSize(30);
setColor(0.8f, 0.2f, 0.2f, 0.8f);
setCanFill(true);

View File

@ -54,10 +54,10 @@ int main(int argc, char** argv) {
osgWidget::Widget* t = frame->getBorder(osgWidget::Frame::BORDER_TOP);
osgWidget::Widget* b = frame->getBorder(osgWidget::Frame::BORDER_BOTTOM);
l->setImage("../examples/osgwidgetframe/images/border-left.tga", true);
r->setImage("../examples/osgwidgetframe/images/border-right.tga", true);
t->setImage("../examples/osgwidgetframe/images/border-top.tga", true);
b->setImage("../examples/osgwidgetframe/images/border-bottom.tga", true);
l->setImage("osgWidget/border-left.tga", true);
r->setImage("osgWidget/border-right.tga", true);
t->setImage("osgWidget/border-top.tga", true);
b->setImage("osgWidget/border-bottom.tga", true);
l->setTexCoordWrapVertical();
r->setTexCoordWrapVertical();
@ -69,9 +69,9 @@ int main(int argc, char** argv) {
osgWidget::Widget* center = new osgWidget::Widget("center", 256.0f, 256.0f);
osgWidget::Widget* right = new osgWidget::Widget("right", 512.0f, 256.0f);
left->setImage("../examples/osgwidgetframe/images/panel-left.tga", true);
center->setImage("../examples/osgwidgetframe/images/panel-center.tga", true);
right->setImage("../examples/osgwidgetframe/images/panel-right.tga", true);
left->setImage ("osgWidget/panel-left.tga", true);
center->setImage("osgWidget/panel-center.tga", true);
right->setImage ("osgWidget/panel-right.tga", true);
center->setTexCoordWrapHorizontal();

View File

@ -22,8 +22,7 @@ const char* INFO =
void setupLabel(osgWidget::Label* label) {
label->setFontSize(16);
label->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
// label->setFont("fonts/monospace.ttf");
label->setFont("fonts/Calibri1.ttf");
label->setFont("fonts/Vera.ttf");
label->setPadding(2.0f);
label->setHeight(18.0f);
label->setCanFill(true);

View File

@ -25,7 +25,7 @@ const char* LABEL2 =
osgWidget::Label* createLabel(const std::string& l, unsigned int size=13) {
osgWidget::Label* label = new osgWidget::Label("", "");
label->setFont("fonts/arial.ttf");
label->setFont("fonts/Vera.ttf");
label->setFontSize(size);
label->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
label->setLabel(l);

View File

@ -17,7 +17,7 @@ const unsigned int MASK_3D = 0x0F000000;
struct ColorLabel: public osgWidget::Label {
ColorLabel(const char* label):
osgWidget::Label("", "") {
setFont("fonts/Calibri1.ttf");
setFont("fonts/Vera.ttf");
setFontSize(14);
setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
setColor(0.3f, 0.3f, 0.3f, 1.0f);

View File

@ -49,7 +49,7 @@ public:
osgWidget::Label* label1 = new osgWidget::Label(ss.str());
label1->setFont("fonts/monospace.ttf");
label1->setFont("fonts/VeraMono.ttf");
label1->setFontSize(20);
label1->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
label1->setColor(0.0f, i / 4.0f, 0.3f, 1.0f);
@ -73,7 +73,7 @@ public:
osgWidget::Label* label2 = new osgWidget::Label(ss.str());
label2->setFont("fonts/monospace.ttf");
label2->setFont("fonts/Vera.ttf");
label2->setFontSize(15);
label2->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
label2->setColor(0.0f, i / 4.0f, 0.3f, 1.0f);
@ -93,7 +93,7 @@ public:
osgWidget::Label* label = new osgWidget::Label("label");
label->setFont("fonts/monospace.ttf");
label->setFont("fonts/arial.ttf");
label->setFontSize(15);
label->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
label->setLabel("Drag the window here...");

View File

@ -88,7 +88,7 @@ int main(int argc, char** argv) {
osgWidget::Frame* frame = osgWidget::Frame::createSimpleFrameWithSingleTexture(
"frame",
"../examples/osgwidgetscrolled/theme-2.png",
"osgWidget/theme-2.png",
64.0f,
64.0f,
16.0f,
@ -101,15 +101,15 @@ int main(int argc, char** argv) {
// This is our Transformers box. :)
osgWidget::Box* box = new osgWidget::Box("images", osgWidget::Box::VERTICAL);
osgWidget::Widget* img1 = new osgWidget::Widget("im1", 256.0f, 256.0f);
osgWidget::Widget* img2 = new osgWidget::Widget("im2", 256.0f, 256.0f);
osgWidget::Widget* img3 = new osgWidget::Widget("im3", 256.0f, 256.0f);
osgWidget::Widget* img4 = new osgWidget::Widget("im4", 256.0f, 256.0f);
osgWidget::Widget* img1 = new osgWidget::Widget("im1", 512.0f, 512.0f);
osgWidget::Widget* img2 = new osgWidget::Widget("im2", 512.0f, 512.0f);
osgWidget::Widget* img3 = new osgWidget::Widget("im3", 512.0f, 512.0f);
osgWidget::Widget* img4 = new osgWidget::Widget("im4", 512.0f, 512.0f);
img1->setImage("../examples/osgwidgetscrolled/images/starscream.jpg", true);
img2->setImage("../examples/osgwidgetscrolled/images/optimus.jpg", true);
img3->setImage("../examples/osgwidgetscrolled/images/megatron.jpg", true);
img4->setImage("../examples/osgwidgetscrolled/images/bumblebee.jpg", true);
img1->setImage("osgWidget/scrolled1.jpg", true);
img2->setImage("osgWidget/scrolled2.jpg", true);
img3->setImage("osgWidget/scrolled3.jpg", true);
img4->setImage("osgWidget/scrolled4.jpg", true);
img1->setMinimumSize(10.0f, 10.0f);
img2->setMinimumSize(10.0f, 10.0f);

View File

@ -1,6 +1,7 @@
// -*-c++-*- osgWidget - Code by: Jeremy Moles (cubicool) 2007-2008
// $Id: osgwidgetshader.cpp 28 2008-03-26 15:26:48Z cubicool $
#include <osgDB/FileUtils>
#include <osgWidget/Util>
#include <osgWidget/WindowManager>
#include <osgWidget/Canvas>
@ -60,12 +61,12 @@ int main(int argc, char** argv) {
program->addShader(osg::Shader::readShaderFile(
osg::Shader::VERTEX,
"osgWidget/osgwidgetshader-vert.glsl"
osgDB::findDataFile("osgWidget/osgwidgetshader-vert.glsl")
));
program->addShader(osg::Shader::readShaderFile(
osg::Shader::FRAGMENT,
"osgWidget/osgwidgetshader-frag.glsl"
osgDB::findDataFile("osgWidget/osgwidgetshader-frag.glsl")
));
canvas->getGeode()->getOrCreateStateSet()->setAttribute(program);