Please list all camera related issues here

As camera issues are second to performance issues I will be making a concerted effort to get them all resolved while I wait on word from Ansca regarding performance.

Please list all issues you are currently having or additions you would like made here, please note that this does not include isometric stuff for now, sorry. [import]uid: 5833 topic_id: 5038 reply_id: 305038[/import]

Am I safe to assume they are all sorted? :wink: [import]uid: 5833 topic_id: 5038 reply_id: 17055[/import]

No. You know my issues [import]uid: 11904 topic_id: 5038 reply_id: 17097[/import]

Hehe, well I mean apart from yours :slight_smile: [import]uid: 5833 topic_id: 5038 reply_id: 17098[/import]

I love to be special! :slight_smile: [import]uid: 11904 topic_id: 5038 reply_id: 17100[/import]

At his moment I’ve got none (I’m sliding maps, setting position etc. with no issues). [import]uid: 12431 topic_id: 5038 reply_id: 18093[/import]

Awesome, that is very good to hear :slight_smile: [import]uid: 5833 topic_id: 5038 reply_id: 18096[/import]

I have just added in a slight change to the movement stuff, now when you call any of the movement functions ( map:move(), map:drag(), map:setPosition(), map:fadeToPosition() and map:slideToPosition() ) that will clamp the position to within the bounds of the map.

Currently the only problem is with the map:slideToPosition() function, because it uses a transition to move naturally I have to call the clamp function as as it moves rather than just at the end however this doesn’t seem to be working. Basically when you call that function Lime will currently register an enterFrame handler where it will then call the clamp function while the transition is active however it seems that the transition overrides my manual position setting so that it only gets clamped at the moment the transition ends whereby it will jump back to within the bounds (if it went out).

If anyone has any ideas for a possible solution to this please speak up :slight_smile:

  • Update -

Thanks to a suggestion from jhocking this is now working :slight_smile: [import]uid: 5833 topic_id: 5038 reply_id: 18310[/import]

Hi,

I’m having an issue with the camera image sizes. I’ve written a program that uses the camera and then saves the images to file using display.save(). Then I recall the images and show them using the slideView (from the sample app). This works great on the simulator, but on the iphone itself, the images always show up huge and with only the top left corner section of the photo visible. I’ve tried to adjust this before I save and after with xScale and yScale but it’s not having any effect.

There’s got to be something obvious that I’m missing here. Any help would be greatly appreciated.

Thanks,
Matt [import]uid: 12578 topic_id: 5038 reply_id: 19312[/import]

Hi Matt,

Sorry this thread is for all issues relating to the use of the Lime camera rather than the use of the hardware camera, you are better off posting your issue in the general forums, developer support probably.

Graham [import]uid: 5833 topic_id: 5038 reply_id: 19720[/import]

Need help to move the map while my flying ball leaves the viewable part of the screen.

  1. I shoot away a ball into the tiled map world
  2. When the ball leaves the screen of before I need to smoothly scroll the map so that it follows the flying ball.

How can I accomplish this? [import]uid: 22737 topic_id: 5038 reply_id: 20233[/import]

You could set the ball as the tracking point of the map - http://justaddli.me/api.php?c=map&m=setTrackingPoint

And then remember to update the map in an enterFrame handler - http://justaddli.me/api.php?c=map&m=update

Note: Currently there is a bug in the update function that will slow down the game when you use it, basically it was me accidentally leaving something commented in when I released the last version so if you go this way you will simply need to comment something out until I release the new version, which will be very soon. [import]uid: 5833 topic_id: 5038 reply_id: 20238[/import]

Hey Graham
Superthanks for the fast answer and the superb library. I love to use Lime with TileEditor and now the camera follows the ball but just for a while, the ball flies out of the screen and the update routine doesn’t seem to keep up the pace with the ball so I can´t see the platform where the ball has landed.

You mention some bug but where should I correct this?

Please help me make the update event faster so the ball doesn’t outrun the platform update. [import]uid: 22737 topic_id: 5038 reply_id: 20403[/import]

To fix the bug, go to “lime-map.lua” and in the update function at line 921 there is a block like this:

  
---[[  
 for i=1, #self.tileLayers, 1 do  
 for j=1, #self.tileLayers[i].tiles, 1 do  
  
 if self.tileLayers[i].tiles[j].sprite then  
  
 if self.tileLayers[i].tiles[j]:isOnScreen() then  
  
 if not self.tileLayers[i].tiles[j].sprite.isVisible then  
 self.tileLayers[i].tiles[j].sprite.isVisible = true  
 -- print("SHOW")  
 end  
  
 else  
  
 if self.tileLayers[i].tiles[j].sprite.isVisible then  
 self.tileLayers[i].tiles[j].sprite.isVisible = false  
 -- print("HIDE")  
 end  
  
 end  
  
 end  
 end  
 end  
--]]  
  

Simply remove this as it was only a quick hack test that wasn’t supposed to be in there.

Also, the other reason you might be experiencing the problem is if your ball is not on a layer. As in if you created it outside of Tiled in your own code, to fix this either create it in Tiled and then access it through your code or use the tileLayer:addObject() function to add it to the layer. [import]uid: 5833 topic_id: 5038 reply_id: 20407[/import]

Hey
I have tried to add the ball to the layer from within my main.lua file but still the ball will outrun the moving screen. I attach the code bellow and maybe you will see something strange in my newbee way of handling this lime / tile editor / corona sdk stuff :slight_smile:

[lua]display.setStatusBar(display.HiddenStatusBar)

– Load Lime
local lime = require(“lime”)

lime.enableScreenCulling()

– Load your map
local map = lime.loadMap(“bouncermap.tmx”)

– Create the visual
local visual = lime.createVisual(map)

local physical = lime.buildPhysical(map)

local physics = require(“physics”)
physics.start()

local layer = map:getTileLayer(“tile1”)
layer:addObject(ball)

local ballBody = { density=0.9, friction=1.0, bounce=0.3, radius=10 }

–local ball = display.newImage(‘ball.png’,100,-50)
local ball = display.newImage(“ball.png”,100,-50)

physics.addBody(ball, ballBody)
ball.isBall = true

ball.linearDamping = 0.3
ball.angularDamping = 0.8

ball.isBullet = true – force continuous collision detection, to stop really fast shots from passing through other balls

target = display.newImage( “target.png” )
target.x = ball.x
target.y = ball.y
target.alpha = 0

– Shoot the cue ball, using a visible force vector
local function ballShot( event )
local t = event.target

local phase = event.phase

if “began” == phase then
display.getCurrentStage():setFocus( t )
t.isFocus = true

– Stop current cueball motion, if any
–t:setLinearVelocity( 0, 0 )
–t.angularVelocity = 0

target.x = t.x
target.y = t.y

startRotation = function()
target.rotation = target.rotation + 4
end

Runtime:addEventListener( “enterFrame”, startRotation )

local showTarget = transition.to( target, { alpha=0.4, xScale=0.4, yScale=0.4, time=200 } )
myLine = nil

elseif t.isFocus then
if “moved” == phase then

if ( myLine ) then
myLine.parent:remove( myLine ) – erase previous line, if any
end
myLine = display.newLine( t.x,t.y, event.x,event.y )
myLine:setColor( 255, 255, 255, 80 )
myLine.width = 8

elseif “ended” == phase or “cancelled” == phase then
display.getCurrentStage():setFocus( nil )
t.isFocus = false

local stopRotation = function()
Runtime:removeEventListener( “enterFrame”, startRotation )

end

local hideTarget = transition.to( target, { alpha=0, xScale=1.0, yScale=1.0, time=200, onComplete=stopRotation } )

if ( myLine ) then
myLine.parent:remove( myLine )
end
physics.start()
– Strike the ball!
t:applyForce( (t.x - event.x)*2, (t.y - event.y)*2, t.x, t.y )

print(event.x)

end
end

– Stop further propagation of touch event
return true
end
map:setFocus(ball)

ball:addEventListener(“touch”, ballShot)

local onUpdate = function(event)
map:update(event)
end
Runtime:addEventListener(“enterFrame”, onUpdate)[/lua] [import]uid: 22737 topic_id: 5038 reply_id: 20632[/import]

If possible could you zip up your project and email it to support@justaddli.me then I can take a proper look at it. [import]uid: 5833 topic_id: 5038 reply_id: 20635[/import]

Just did :slight_smile: [import]uid: 22737 topic_id: 5038 reply_id: 20643[/import]

Hey guys, first post on here, sorry this sounds terribly noobish. I’m very new to coding!

Here’s the deal. I’m creating a platformer and I’m having the camera follow along the player with something like this…

local onUpdate = function(event)  
 if player then map:setPosition(player.x, player.y) end  
 map:update(event)  
end  
Runtime:addEventListener("enterFrame",onUpdate)  

But of course, if I try to use the map:slideToPosition() as a result of a collision trigger, it obviously won’t work because I’m constantly telling the camera to follow the player on every frame. Is there any way around this? [import]uid: 37480 topic_id: 5038 reply_id: 22652[/import]

Pretty new at programming myself, but maybe if you checked for collision or trigger before running the update map? inside the onUpdate function. and if there was a collision it would skip the map update. [import]uid: 17969 topic_id: 5038 reply_id: 22660[/import]

Hmm ok thanks borgb, I think I see what you’re getting at. I’ll give it a shot soon and post my results. [import]uid: 37480 topic_id: 5038 reply_id: 22880[/import]