Adding Scroll Background and picture

Hi guys,
im currently using a template made by peach for a BBQ Cookbook and coming across a few headaches.
What i would like to do is have a recipe and underneath a picture of the dish. Also would like for the text to have the notepad background that ive used on the title page, without the logo of course, to move withthe text not the text move over the background. any help would be much appreciated and thanks again to peach for her template!. ill provide details below.

http://imgur.com/RRcZc
http://imgur.com/RRcZc&CHYVGl

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
 
 
module(..., package.seeall)
 
-- Main function - MUST return a display.newGroup()
function new()
        local localGroup = display.newGroup()
 
local background = display.newRect(0, 0, display.contentWidth, display.contentHeight)
background:setFillColor(140, 140, 140)
 
-- Setup a scrollable content group
local topBoundary = display.screenOriginY
local bottomBoundary = display.screenOriginY
local scrollView = scrollView.new{ top=topBoundary, bottom=bottomBoundary }
 
local myText = display.newText("Barbecued beef with pepper crust", 0, 0, native.systemFontBold, 16)
myText:setTextColor(0, 0, 0)
myText.x = math.floor(display.contentWidth*0.5)
myText.y = 48
scrollView:insert(myText)
 
-- add some text to the scrolling screen
 
local lotsOfText = "Ingredients (serves 6)\n\n\n1 tablespoon olive oil\n2 teaspoons ground mixed peppercorns\n1 tablespoon wholegrain mustard\n2 teaspoons chopped fresh thyme leaves\n1 1/2 cups barbecue sauce\n1.4kg piece beef scotch fillet\n\n\nMETHOD\n\n1. Preheat barbecue to high, leaving hood closed. Tie beef with kitchen\nstring at 4cm intervals (to maintain shape during cooking). Combine oil,\npepper, mustard, thyme and 1/2 cup sauce in a flameproof roasting pan.\nAdd beef. Turn to coat.\n\n2.Transfer beef to barbecue chargrill, reserving oil mixture. Cook, turning, for 5 minutes or until browned all over. Return beef to pan. Reduce heat to low. Baste beef with oil mixture. Cook, covered, for 1 hour for medium or until cooked to your liking.\n\n3.Remove beef. Cover with foil. Stand for 15 minutes. Slice. Serve with remaining barbecue sauce.\n\n NOTES\n\nIf you would prefer to cook the beef in the oven, preheat oven to 200°C/180°C fan-forced. Cook for 50 minutes for medium or until cooked to your liking. Always rest meat, loosely covered in foil, after cooking. This allows the meat to retain moisture and succulence."
 
local lotsOfTextObject = util.wrappedText( lotsOfText, 39, 14, native.systemFont, {0,0,0} )
scrollView:insert(lotsOfTextObject)
lotsOfTextObject.x = 24
lotsOfTextObject.y = math.floor(myText.y + myText.height)
 
 
-- Important! Add a background to the scroll view for a proper hit area
local scrollBackground = display.newRect(0, 0, display.contentWidth, scrollView.height+64)
scrollBackground:setFillColor(255, 255, 255)
scrollView:insert(1, scrollBackground)
scrollView:addScrollBar()
 
local back = display.newImage ("back.png")
back.x = math.floor(display.contentWidth*0.88)
back.y = 445
back.isHitTestable = true
 
local function goback (event)
myText.isVisible = false
scrollBackground.isVisible = false
background.isVisible = false
lotsOfTextObject.isVisible = false
director:changeScene ("menu")
back:removeSelf()
end
back:addEventListener("touch",goback)
 
--------------------------------------------------------------------
--------------------------------------------------------------------
        -- MUST return a display.newGroup()
        return localGroup
end

Also would like for the text to have the notepad background that ive used on the title page, without the logo of course, to move withthe text not the text move over the background.

I am trying to do this also anyone able to help?

The method I am thinking would involve creating a rectangle off the screen to the dimensions of the content, then repeating an image until it is the same height of this rectangle, then deleting the original rectangle leaving us with the background image group equal to the correct height of the content.

Need to investigate this further...

views:1407 update:2011/9/27 8:54:05
corona forums © 2003-2011