Jump to content
Sign in to follow this  
Nebula

Add a scrollbar to the information window.

Recommended Posts

Help add a scrollbar to the info window. Here is the code I use ...

 

DreamsWindow = ISCollapsableWindow:derive("DreamsWindow");
DreamsWindow.compassLines = {}

function DreamsWindow:initialise()
	ISCollapsableWindow.initialise(self);
end

function DreamsWindow:new(x, y, width, height)
	local o = {};
	o = ISCollapsableWindow:new(x, y, width, height);
	setmetatable(o, self);
	self.__index = self;
	o.title = getText("IGUI_Dreams_Window");
	o.pin = false;
	o:noBackground();
	return o;
end

function DreamsWindow:setText(newText)
	DreamsWindow.HomeWindow.text = newText;
	DreamsWindow.HomeWindow:paginate();
	
	local tempTexture = getTexture("media/textures/dreams/dreams.png")
	if (tempTexture) then self.Image:setImage(tempTexture) 
	else self.Image:setImage(getTexture("media/textures/dreams/dreams.png")) end
end


function DreamsWindow:createChildren()
	ISCollapsableWindow.createChildren(self);
	
	self.Image = ISButton:new(10, 25, 240, 240, " ", nil, nil);
    self.Image:setImage(getTexture("media/textures/dreams/dreams.png"))
    self.Image:setVisible(true);
	self.Image:setEnable(true);
--	self.Image:addToUIManager();
	self:addChild(self.Image)
	
	self.HomeWindow = ISRichTextPanel:new(260, 25, 340, 240);
	self.HomeWindow:initialise();
	self.HomeWindow.autosetheight = true
	self.HomeWindow:ignoreHeightChange()
	self:addChild(self.HomeWindow)
end

function DreamsWindowCreate()
	DreamsWindow = DreamsWindow:new(330, 330, 610, 275)
	DreamsWindow:addToUIManager();
	DreamsWindow:setVisible(false);
	DreamsWindow.pin = false;
	DreamsWindow.resizable = false;
end

Events.OnGameStart.Add(DreamsWindowCreate);

Please help, really needed.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...