Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 4:52 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: urgent : tiled pictures upside down?
PostPosted: January 8th, 2007, 11:02 am 
Offline

Joined: November 3rd, 2004, 11:08 am
Posts: 14
Hello all,

What i did here was making a frame and inside the frame i had alot of square images. Then i made a frame2 just like frame1 and only renamed all the images inside with an extra x at the end. I give all images the same background and let this code run first:
Code:
for(num=1;num<=20;num++)
{
eval("PICTURE"+num+"=set_image")
}
ConvertScale();
Convert();
alignX();
alignY();
Frame1.Show()

checkDesign="ok"

Frame2.Show();
xConvertScale();
xConvert();
xalignX();
xalignY();
menutoggleo=1;
Frame2.Hide();


this will do all the functions for frame 1 and then the same functions ( with an x infront ) for frame 2. But somehow i always end up with all the backgrounds of frame 1 to be upside down, while those of frame 2 remain normal. Any solutions? Thank you alot!

Code:
function ConvertScale()
{

         var setX = String.format('2.2',Width/1000)
         var setY = String.format('2.2',Height/1000)
         var getY = 688-(setY*100)//768 is the measure Y from Frame1
   
   while (operator <=20)
   {
         for (num=1 ; num<=15 ; num++) {
         var findImage = Frame1.FindChild("Image"+operator+"_"+num)
         findImage.SetScale(-setX,-setY)
         //berekening van de grootte van de image
         var tempber = 199*setX/2
         //einde berekening
         //findImage.SetPositionX(setX*100)
         //ff testje
         findImage.SetPositionX(tempber+JOINT)
         //einde testje
         findImage.SetPositionY(getY)
         }
   operator +=1
   }
operator = 1
}
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
// convert Width and Height into a scalable conversion ONLY X1 etc and Y1 etc
function Convert()
{
         for (num=1 ; num<=20 ; num++)
      {
         var setX = eval("X1_"+num+ "=200*(String.format('2.2',Width/1000))")
         var setY = eval("Y"  +num+ "=200*(String.format('2.2',Height/1000))")
            var checkX = setX *5
            var checkY = setY *5
            var nameX = String.right(checkX,1)
            var nameY = String.right(checkY,1)

            if (nameX  == 0)
               {
               eval("X1_"+num+"=Number(setX)+Number(1)")
               }
            if (nameY == 0)
               {
               eval("Y"+num+"=Number(setY)+Number(1)")
               }
      }
}


////////////////////////
//////////////////////////////////////////////////////
var startX = 0

function alignX()
{
var getX = eval ("X1_1")
var AA = getX / 2
var placePosX = getX + Number(JOINT)
   while (operator <= 20)
   {
   var tempall = 0
      for (num=1 ; num<=15 ; num++)
      {
      
         if(num!=1)
         {
         tempall = (tempall + 2*(199*Width/1000/2))
         }
         else
         {
         tempall = (tempall + (199*Width/1000/2))
         }
         
         startX +=placePosX
   
         var findImage = Frame1.FindChild("Image"+operator+"_"+num)
         //findImage.SetPositionX(startX-AA)
         findImage.SetPositionX(tempall+num*JOINT)
      }
   operator += 1
   startX = 0
   }
operator = 1
startX = 0
}
//////////////////////////////////////////////////////////////////////
///////////////////////////////////////
var startY = 0

function alignY()
{
operator = 2

var placePosY = Y1 + Number(JOINT)
   while (operator <= 20)
   {
   startY += Number(placePosY)
      for (num=1 ; num<=15 ; num++)
      {
      var findImage = Frame1.FindChild("Image"+operator+"_"+num)
      findImage.MoveY(-startY)
      }
   operator += 1
   }
operator = 1
startY = 0
}
//////////////////////////////////////////////////////////////////////
function Colour()
{
var sel_style = new Object();
sel_style.backgroundcolour = set_colour

var obj = eval("Data1");
obj.SetSelection(0, -1);
obj.SetSelectionStyle(sel_style);
}
////////////////////////////////////////////////////////////////////////////////////
function decor()
{
Debug.trace("\n uhm ->" + arrayNr)
Debug.trace("\n enne ->" + decorX[arrayNr] + " & " + decorY[arrayNr] + "\n")
var SST1 = Number(eval("decorX["+arrayNr+"]"))
var SST2 = Number(eval("decorY["+arrayNr+"]"))
   
   if (imageNum !="" && Edit2 == "Decor")
   {
   var setX = String.format('2.2',SST1/1000)
   var setY = String.format('2.2',SST2/1000)
   var cloneA = eval("Image_dec"+imageNum).CloneObject()
   cloneA.Show()
   eval(cloneA).SetScale(-setX,-setY)


   var pos = eval(name).GetPosition()
   xPos = pos.x
   yPos = pos.y

   eval(cloneA).SetPosition(xPos,yPos)
   }
      if (Edit2 == "Decor" && imageNum =="")
      {
      Error = ws9
      GotoPage("Page_error")
      }
         if (Edit2 != "Decor" )
         {
         Error = ws10
         GotoPage("Page_error")
         }
}   
   
////////////////////


//////////////////////////////////////////////////
   
function xConvertScale()
{
var setX = String.format('2.2',Width/1000)
var setY = String.format('2.2',Height/1000)
var getY = 688-(setY*100)
var operator=1
while (operator <=20)
{
      for (var num=1 ; num<=15 ; num++)
      {
      eval("Image"+operator+"_"+num+"x").SetScale(setX,setY)
      var tempber = 199*setX/2
      eval("Image"+operator+"_"+num+"x").SetPositionX(tempber+JOINT)
      eval("Image"+operator+"_"+num+"x").SetPositionY(getY)
      }
   operator +=1
   }
operator = 1
}
function xConvert()
{
         for (num=1 ; num<=20 ; num++)
      {
         var setX = eval("X1_"+num+ "=200*(String.format('2.2',Width/1000))")
         var setY = eval("Y"  +num+ "=200*(String.format('2.2',Height/1000))")
            var checkX = setX *5
            var checkY = setY *5
            var nameX = String.right(checkX,1)
            var nameY = String.right(checkY,1)

            if (nameX  == 0)
               {
               eval("X1_"+num+"=Number(setX)+Number(1)")
               }
            if (nameY == 0)
               {
               eval("Y"+num+"=Number(setY)+Number(1)")
               }
      }
}
function xalignX()
{
var getX = eval ("X1_1")
var AA = getX / 2
var placePosX = getX + Number(JOINT)
   while (operator <= 20)
   {
   var tempall = 0
      for (num=1 ; num<=15 ; num++)
      {
      
         if(num!=1)
         {
         tempall = (tempall + 2*(199*Width/1000/2))
         }
         else
         {
         tempall = (tempall + (199*Width/1000/2))
         }
         
         startX +=placePosX
   
         //var findImage = Frame2.FindChild("Image"+operator+"_"+num+"x")
         eval("Image"+operator+"_"+num+"x").SetPositionX(tempall+num*JOINT)
      }
   operator += 1
   startX = 0
   }
operator = 1
startX = 0
}
function xalignY()
{
operator = 2

var placePosY = Y1 + Number(JOINT)
   while (operator <= 20)
   {
   startY += Number(placePosY)
      for (num=1 ; num<=15 ; num++)
      {
      //var findImage = Frame2.FindChild("Image"+operator+"_"+num+"x")
      eval("Image"+operator+"_"+num+"x").MoveY(-startY)
      }
   operator += 1
   }
operator = 1
startY = 0
}


For this message DeMoN has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: January 8th, 2007, 11:18 am 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
I would suspect that it's this line:
Code:
findImage.SetScale(-setX,-setY)

which will scale the object "inside out".

_________________
ddww Opus Developer


For this message Duncan Lilly has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 41 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group